Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Audio and Video / Re: BASS DLL
« Last post by d2010 on Today at 07:47:33 am »
--
Here is many version of bass.dll alternative way.
Perhaps  the bass.net.dll is good enough?
I use 7zip version 9.16 form2010year.
2
General / Re: [Solved]Printing unicode one character at a time
« Last post by bobonwhidbey on Today at 05:23:56 am »
Very nice.  Thanks Bennny
3
Other / Re: Interesting article about AI
« Last post by 440bx on Today at 04:36:02 am »
Yes things are getting worse the more technology is used to replace people. Nobody even seems to care what will happen to hundreds of millions of people who could end up with no way to support themselves  because they were replaced by Ai.
That may be a valid argument but it is a precarious one.

The Luddites made that argument long ago and they were partially right.  Those jobs, basically no longer exist due to machines.

The ever present goal of today's societies (regardless of economic model) is to maximize productivity.  This is what lowers costs, something that you and just about everyone wants done (people are always trying to get the most for the least amount of money.)  Machines accomplish that at the cost of human jobs.

The important point is that, in the long run, AI or any other form of automation can only replace humans in the performance of an activity if and only if it becomes capable of performing the same activity to a somewhat acceptable level.

When it comes to programming, AI is barely capable of providing a programmer with pieces of code that can be pasted together.  Some self proclaimed "programmers" do have something to worry about but, for some reason I find it hard to sympathize with them.

Your comment reminds me of a conversation I had just a few days ago about a company replacing customer support personnel with AI.  Basically replacing very poorly trained people who regurgitate stuff written on a sheet of standard questions and answers.  These people are usually  in a call center in a third world country, usually barely speak the language and, they usually have such a heavy accent that they are difficult to comprehend.  These people are rather likely to be replaced by A.I

A.I can help automate some tasks as long as the task requires _no_ intelligence whatsoever (and even that is limited by the user's ability to ask questions "properly")

The day that thing can figure out a shorter (and correct) proof to Fermat's last theorem entirely by itself, that day there will be something to be concerned about.

Today, the concern is that people of limited capabilities are going to misuse A.I because they want to be part of the "in" thing.  Binary fashion, "this program is an Armani/Dior/Lanvin/Gucci/"whatever floats your boat".  Move over Knuth.
4
Other / Re: had a question and found answer
« Last post by egsuh on Today at 03:57:14 am »
It's quite interesting that I spend several hours at least not days to solve a problem without success, I decide to ask for help in this forum, and after a few munites since I write the question here I find a solution.
5
Other / Re: had a question and found answer
« Last post by Joanna from IRC on Today at 03:24:04 am »
Maybe you need somewhere to chat  ;)
6
Other / Re: Interesting article about AI
« Last post by Joanna from IRC on Today at 03:21:00 am »
I’ve often found that in order to ask good questions you have to be knowledgeable about the topic that you’re asking questions about or even know what the correct answer is already.

I once needed help making a complicated cte with sql for my project but only had rudimentary knowledge of sql language. I didn’t know all the proper terminology and jargon with which to ask the question and most of the people could not understand what I was talking about and tried to give me unhelpful canned responses. It was extremely frustrating for everyone involved. Then I went somewhere else and found someone who was more intuitive than the others who showed me how it’s done and gave me some code that I could modify.

I seriously doubt that AI can do better than live people at coming up with good answers. I don’t want people to be replaced with AI because it’s “faster”. That will be a as useful as only being allowed to talk to to a computer on the phone which puts me on hold and then hangs up. [Yes this is a tactic used by people who steal money}

Yes things are getting worse the more technology is used to replace people. Nobody even seems to care what will happen to hundreds of millions of people who could end up with no way to support themselves  because they were replaced by Ai.
7
General / Re: [Solved]Printing unicode one character at a time
« Last post by cdbc on Today at 02:47:40 am »
Hi
Here's quick and dirty test unit:
Code: Pascal  [Select][+][-]
  1. unit view.main;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, StdCtrls,SysUtils, Forms, Controls, Graphics, Dialogs;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Button1:TButton;
  13.     procedure Button1Click(Sender:TObject);
  14.     procedure FormPaint(Sender:TObject);
  15.   private
  16.     fstr: string;
  17.   public
  18.     procedure AfterConstruction;override;
  19.   end;
  20.  
  21. var
  22.   Form1: TForm1;
  23.  
  24. implementation
  25. uses LazUnicode;
  26. {$R *.lfm}
  27.  
  28. procedure TForm1.FormPaint(Sender:TObject);
  29. var
  30.   i, x, y: Integer;        uc: UnicodeChar;
  31.   ch: String;              us: UnicodeString;
  32. begin
  33.   Canvas.Brush.Style:= bsClear;
  34.   Canvas.Pen.Style:= psSolid;
  35.   Canvas.Font.Name:= 'DejaVu Sans Mono';
  36.   Canvas.Font.Size:= 14;
  37.   Canvas.Font.Quality:= fqAntialiased;
  38.   x := 10;
  39.   y := 50;
  40.   i := 0;
  41.   for ch in fstr do
  42.   begin
  43.     if odd(i) then
  44.        Canvas.Font.Color := clRed
  45.     else
  46.        Canvas.Font.Color := clGreen;
  47.     Canvas.TextOut(x,y, ch);
  48.     x := x+Canvas.TextWidth(ch)+4;
  49.     inc(i);
  50.   end;
  51.  
  52.   us:= UTF8Decode(fstr);
  53.   x := 10;
  54.   y := 100;
  55.   i := 0;
  56.   for uc in us do begin
  57.     if odd(i) then
  58.        Canvas.Font.Color := clFuchsia
  59.     else
  60.        Canvas.Font.Color := clAqua;
  61.     Canvas.TextOut(x,y, uc);
  62.     x := x+Canvas.TextWidth(uc)+4;
  63.     inc(i);
  64.   end;
  65. end;
  66.  
  67. procedure TForm1.AfterConstruction;
  68. begin
  69.   inherited AfterConstruction;
  70.   fstr:= 'æ ø å Æ Ø Å ñ';
  71. end;
  72.  
  73. procedure TForm1.Button1Click(Sender:TObject);
  74. begin
  75.   fstr:= InputBox('Draw-string','What to draw:','På fjelltur');
  76. end;
  77.  
  78. end.
  79.  
...and screenshot attached...
Regards Benny
8
Graphics / Re: How to set the desktop color
« Last post by Fibonacci on Today at 02:42:15 am »
I'm sorry but I have quite literally zero idea how to convert a TColor to a binary number that would work with that.

You know HTML hex colors? RGB? TColor is the same, but in reverse, and with alpha channel byte. Look at the link to coolors.co, I put there all these colors but without the first byte (presumably the alpha channel).

I might be misreading this but it sets the accent color which I may be wrong will only work if you're actually got the accent being set option by the desktop wallaper??

If thats not what you wanted then Im lost.. Run the code and see for yourself.
9
Graphics / Re: How to set the desktop color
« Last post by zxandris on Today at 02:34:23 am »
I'm sorry but I have quite literally zero idea how to convert a TColor to a binary number that would work with that.  Also I might be misreading this but it sets the accent color which I may be wrong will only work if you're actually got the accent being set option by the desktop wallaper??

Got it. Now your turn - figure out the colors, create functions and share ;)

Code: Pascal  [Select][+][-]
  1. uses SysUtils, Registry;
  2.  
  3. function tohex(p: pointer; len: dword): string;
  4. var
  5.   i: integer;
  6. begin
  7.   result := '';
  8.   for i := 0 to len-1 do result += inttohex(pbyte(p+i)^, 2);
  9. end;
  10.  
  11. function tobin(s: string): string;
  12. var
  13.   i: integer;
  14. begin
  15.   result := '';
  16.   i := 1;
  17.   while i < length(s) do begin
  18.     result += chr(strtoint('$'+copy(s, i, 2)));
  19.     inc(i, 2);
  20.   end;
  21. end;
  22.  
  23. var
  24.   s: string;
  25.  
  26. begin
  27.   with TRegistry.Create do begin
  28.     RootKey := HKEY_CURRENT_USER;
  29.     OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent', false);
  30.  
  31.     // read
  32.     //setlength(s, 32);
  33.     //ReadBinaryData('AccentPalette', s[1], 32);
  34.     //writeln('palette = ', tohex(@s[1], length(s)));
  35.     //writeln('StartColorMenu = ', ReadInteger('StartColorMenu'));
  36.     //writeln('AccentColorMenu = ', ReadInteger('AccentColorMenu'));
  37.  
  38.     // apply yellow
  39.     s := tobin('FFE8A800FFE08C00FFD35C00FFB90000BA890000805E00004D38000000B29400');
  40.     WriteBinaryData('AccentPalette', s[1], length(s));
  41.     WriteInteger('StartColorMenu', -16741958);
  42.     WriteInteger('AccentColorMenu', -16729601);
  43.  
  44.     // apply green
  45.     //s := tobin('C1F7DD00A6F7D00068E3A80000CC6A000087460000522A00002B1600E3008C00');
  46.     //WriteBinaryData('AccentPalette', s[1], length(s));
  47.     //WriteInteger('StartColorMenu', -12155136);
  48.     //WriteInteger('AccentColorMenu', -9778176);
  49.  
  50.     Free;
  51.   end;
  52. end.



Yellow:
https://coolors.co/e8a800-e08c00-d35c00-b90000-890000-5e0000-380000-b29400
10
Audio and Video / Re: MIDI commands
« Last post by finlazarus on Today at 02:26:09 am »
The most simple demo which sends MIDI messages (notes) to the sound card.
Remember 'MMSystem' (Win) in Uses clause.
It needs one Button on the Form:



Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, MMSystem;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     procedure Button1Click(Sender: TObject);
  17.     procedure FormCreate(Sender: TObject);
  18.     procedure FormDestroy(Sender: TObject);
  19.  
  20.   private
  21.     MidiOutHandle: HMIDIOUT;
  22.     procedure SelectInstrument(Instrument: Byte);
  23.     procedure PlayNote(Note: Byte; Velocity: Byte; Duration: Integer);
  24.  
  25.   public
  26.  
  27.   end;
  28.  
  29. var
  30.   Form1: TForm1;
  31.  
  32. implementation
  33.  
  34. {$R *.lfm}
  35.  
  36. { TForm1 }
  37.  
  38. procedure TForm1.FormCreate(Sender: TObject);
  39. begin
  40.   // Open default MIDI device
  41.   if midiOutOpen(@MidiOutHandle, MIDI_MAPPER, 0, 0, CALLBACK_NULL) <> MMSYSERR_NOERROR then
  42.     raise Exception.Create('MIDI open error');
  43.  
  44.   SelectInstrument(11); //Vibraphone
  45.  
  46. end;
  47.  
  48. procedure TForm1.Button1Click(Sender: TObject);
  49. begin
  50.   // Play notes: MIDI note nr, Velocity 100, Duration
  51.   PlayNote(60, 100, 500);
  52.   PlayNote(62, 100, 500);
  53.   PlayNote(64, 100, 250);
  54.   PlayNote(62, 100, 250);
  55.   PlayNote(60, 100, 500);
  56.  
  57. end;
  58.  
  59. procedure TForm1.FormDestroy(Sender: TObject);
  60. begin
  61.   // Close the MIDI device
  62.   midiOutClose(MidiOutHandle);
  63. end;
  64.  
  65. procedure TForm1.SelectInstrument(Instrument: Byte);
  66. var
  67.   ProgramChangeMsg: DWORD;
  68. begin
  69.   // MIDI Program Change message (channel 0)
  70.   ProgramChangeMsg := $C0 or (Instrument shl 8);
  71.   midiOutShortMsg(MidiOutHandle, ProgramChangeMsg);
  72. end;
  73.  
  74. procedure TForm1.PlayNote(Note: Byte; Velocity: Byte; Duration: Integer);
  75. var
  76.   NoteOnMsg: DWORD;
  77.   NoteOffMsg: DWORD;
  78. begin
  79.   // MIDI Note On (Channel 0)
  80.   NoteOnMsg := $90 or (Note shl 8) or (Velocity shl 16);
  81.   midiOutShortMsg(MidiOutHandle, NoteOnMsg);
  82.  
  83.   // Wait
  84.   Sleep(Duration);
  85.  
  86.   // MIDI Note Off (Channel 0)
  87.   NoteOffMsg := $90 or (Note shl 8) or (0 shl 16); // Velocity 0 = Note Off
  88.   midiOutShortMsg(MidiOutHandle, NoteOffMsg);
  89. end;
  90.  
  91. end.  
  92.  
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018