|
David O'Neil wrote: look at the AI wars is to view it as our oligarchs trying to figure out ways to monetize it -vs- the geeks who like playing with it for the technology itself. (And the general population, some scared, some not.) Yes, monetize !
imho: geeks intelligent people who see the potential in AI demonstrated now in diverse domains, amd experience it now using it ... i use ReSharper's AI code generation assistant: it is awesome even in beta !
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Thanx for REM reminder. Forgot about that one.
As to your AI view, I agree.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
This my friends, is really neat.
With my GFX library:
template<size_t BitDepth>
using bgrx_pixel = gfx::pixel<
gfx::channel_traits<gfx::channel_name::B,(BitDepth/4)>,
gfx::channel_traits<gfx::channel_name::G,((BitDepth/4)+(BitDepth%4))>,
gfx::channel_traits<gfx::channel_name::R,(BitDepth/4)>,
gfx::channel_traits<gfx::channel_name::nop,(BitDepth/4),0,(1<<(BitDepth/4))-1,(1<<(BitDepth/4))-1>
>;
You can then do auto col = color<bgrx_pixel<32>>::purple and get a pixel back in the format of 0xBBGGRRFF (where RR GG and BB are each a byte and represent the red, green, and blue color channels, and FF is just a NOP channel - unused - and set to 0xFF). Purple would be like 0xFF00FFFF.
With this you can create bitmaps (bitmap<bgrx_pixel<32>> )in this format and feed them right to DirectX, which happily eats bitmaps with this pixel footprint.
The template code to make this work is pretty crazy. The fact that it's pretty easy to declare new pixel formats made it possible for me to port my code from IoT to DirectX on a PC so I can rapidly prototype without having to upload to a device each time.
I've never really used this feature in the wild. My color format is usually either 16-bit color, monochrome or grayscale.
It was confusing at first though because originally my nop channel was an alpha channel, and so it wasn't rendering (black screen) because DirectX is set to ignore that channel, and my GFX library assumed it would be respected.
Anyway, after I overcame that the rest was easy. Same code of mine works in Arduino, ESP-IDF, probably Zephyr, and now the PC.
Say what you want about C and C++ they truly run everywhere.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Congratulations! That is worthy of a celebration, however you celebrate! Someday maybe I'll have time to master such code as well - it sounds fun!
|
|
|
|
|
What I find really amazing is that the compilers can actually deal with such source. You can probably guess that i have never written a compiler.
|
|
|
|
|
Nor me I leave that to the propeller heads
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
C++ compilers are something else, even at that. Pure magic.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
I'm wondering how it will work in 32/64?
I mean at compile time, where you don't know what the target machine runs on.
|
|
|
|
|
I have some information about the target machine like endianness and word size. If I don't support the platform you can fill in the information with -D defines.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I should add, this routinely runs on 32-bit machines. This code is now running on a 64-bit machine.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Does 32 not run in 64?
The other way around I know that is not possible / so easy, but I thought 32 would not be a big deal in 64
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
You're thinking of the x86 platform. That might not apply to microcontrollers or SBCs.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
true
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I have a need to write a small SQL parser and try to look for an example.
my SQL parser is very minimal: just need to extract all field names and tables that are used this SQL statements.
any good example to recommend?
my business need is to extract all field names and database names associated with these fields:
select a.var1,
a.var2,
b.var3,
b.var4
from db1 a left join db2 b
on a.var5=b.var5
;
my need is to put these vars into this form in Excel workbook:
db1 var1
db1 var2
db2 var3
db2 var4
thanks a million!
diligent hands rule....
modified 5 days ago.
|
|
|
|
|
GoldParser has a SQL Grammar for it. You might use that. Just google GoldParser. It's for .NET and I think old VB
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
diligent hands rule....
|
|
|
|
|
For what purpose? What are you trying to do? It sounds like a bad idea.
|
|
|
|
|
my business need is to extract all field names and database names associated with these fields:
select a.var1,
a.var2,
b.var3,
b.var4
from db1 a left join db2 b
on a.var5=b.var5
;
my need is to put these vars into this form in Excel workbook:
db1 var1
db1 var2
db2 var3
db2 var4
diligent hands rule....
modified 5 days ago.
|
|
|
|
|
It's not something I would want to tackle. I suppose that handling the basics like you show could be doable, but things like subqueries and CTEs would be problematic.
Do you think you'll need to support things like
SELECT X + Y AS Z ... ?
And which flavor of SQL? PL/SQL, T-SQL, etc.
|
|
|
|
|
Probably something that I would enjoy doing but not sure I would attempt to say it was "small".
I agree with your examples.
Not to mention is the SQL only going to come from SQL scripts? Or also from other code bases.
|
|
|
|
|
|
thanks for the link. I prefer SQL datatable one.
diligent hands rule....
|
|
|
|
|
A good example no, sorry.
But next question I recommend you to write it in the proper section
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I just look for some thoughts here, not a specific language implementation.
I may need to implement my request by other scripting languages such as SAS.
diligent hands rule....
|
|
|
|