15,792,771 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by honey the codewitch (Top 200 by date)
honey the codewitch
11-Nov-23 20:14pm
View
I solved it but I'm not sure how exactly so I don't know what to put for a solution!
honey the codewitch
11-Nov-23 17:13pm
View
its usb cdc serial. if there's a way to control handshaking on it, i wouldn't know. this same technique works for other projects.
honey the codewitch
9-Nov-23 9:15am
View
In that case it's not practical, because the user may need to select the heap to use at runtime, and will typically be using multiple heaps at the same time. Overloading new *could* get you that, if you made it call out to some switchable allocation scheme, but it's clumsier than using emplace new inside my libs
honey the codewitch
9-Nov-23 8:55am
View
In IoT and embedded you have different physical heaps with different sizes and performance characteristics. You have PSRAM and SRAM for example. Because of this, a user of my lib can choose the allocators to use when it needs to dynamically allocate RAM. Right now I've been very careful about RAII on anything that is the target of those allocations, but I'd rather use placement new and fire the constructors cleanly.
honey the codewitch
9-Nov-23 8:53am
View
+5 thanks. Wow, here I thought it was just a variant of the keyword new. I guess it's a function? Odd.
honey the codewitch
9-Nov-23 4:36am
View
This is the standard new operator. Not the emplace new operator. I am trying to call new on an existing buffer using the emplace new operator.
honey the codewitch
4-Oct-23 9:49am
View
didn't work
honey the codewitch
4-Oct-23 9:43am
View
Ah, I'll give it a shot
honey the codewitch
30-Sep-23 0:30am
View
It didn't seem to make any difference, as long as I was consistent (always using the dllmain hinstance vs always using the result of GetModuleHandle(NULL) ). They were clearly different handles, but windows didn't seem to care. I imagine it makes a difference if you were loading resources though, because if you used the GetModuleHandle(NULL) it would try to load them from the exe instead of the DLL. Since I'm not using resources it made - as far as I can tell, no discernable difference.
honey the codewitch
24-Sep-23 7:07am
View
I've tried both. Same result.
honey the codewitch
23-Sep-23 22:25pm
View
if you're game.. https://github.com/codewitch-honey-crisis/winduino/blob/main/winduino_hardware/spi_screen/spi_screen.cpp
Start scanning after line 240, see if anything jumps out at you. And pardon the mess. There is no factoring right now. Just trying to get it to work as a proof of concept at the moment.
honey the codewitch
23-Sep-23 22:06pm
View
I was able to get it to start logging, and it has called my WndProc, so that's not the issue.
The other thing that's weird, and that I don't understand at all, is that window is the ONLY one that's hourglassing and going non-responsive. This despite the fact that all windows are on the same thread/message pump. How is that even possible? They are cooperatively tasked within the same thread.
honey the codewitch
23-Sep-23 21:12pm
View
He's saying their shouldn't be any problem since everything shares the same process address space, as long as it's all operating on the same thread (which it is).
All of that is what I expect. I was looking for things I *wasn't* expecting at this point.
I still can't find the problem, but I don't think it's the above. I just don't know what it is.
honey the codewitch
23-Sep-23 19:13pm
View
I'll go ahead and accept this, as it all jibes with what I was expecting. Seems my problem lies elsewhere.
honey the codewitch
23-Sep-23 18:37pm
View
Yeah, I'm aware of what an hinstance is. But I did not know about that bug, thanks. I tried replacing GetModuleHandle(NULL) with the hinstance from DllMain and it did not like that at all. It wouldn't even register the window class i think (hard to tell because i can't debug and logging is limited)
honey the codewitch
23-Sep-23 16:31pm
View
I'll try that. I'm using GCC and don't currently have a DllMain to grab the HINSTANCE off of but I can sort that out, thanks.
honey the codewitch
22-Sep-23 7:01am
View
thank you again!
honey the codewitch
22-Sep-23 7:00am
View
Should be, but aren't, and I don't care, because the other HWND works for SetWindowText. Good enough for me. GDB doesn't like me anyway.
honey the codewitch
21-Sep-23 22:00pm
View
I was hoping you could clarify something since I'm not seeing the sample you're suggesting.
The following is in my code. This appears to be user mode, because _KERNEL_MODE is not defined in my code. So am I already using the User Mode Driver Framework here?
#ifdef _KERNEL_MODE
#include <ntddk.h>
#else
#include <windows.h>
#endif
#include <wdf.h>
honey the codewitch
21-Sep-23 3:55am
View
Amazing! Thank you so much!
honey the codewitch
20-Sep-23 15:08pm
View
thanks. i'll give it a look
honey the codewitch
20-Sep-23 14:07pm
View
That's what I've started with, but I can't find that. I'll look again.
honey the codewitch
13-Sep-23 12:18pm
View
My code above was fine for the most part. The issue was my graphics library! There was a latent bug, sitting in there for maybe a year or more? It didn't handle bitmaps with alpha channels correctly - i was actually corner casing for it when I shouldn't have been. Simplified the code to remove that special casing, and bam! everything works as expected. Thanks again!
honey the codewitch
13-Sep-23 11:21am
View
I had to do some porting because I'm on GCC but I'm going to go ahead and accept this. Copying your code into mine didn't help, so my problem lies elsewhere. I will instead start with your code, and build it up. Thank you for your help.
honey the codewitch
13-Sep-23 10:39am
View
In my code, any pixel created with an alpha channel, such as the bgra_pixel<32> used above has it's alpha defaulted to full opacity, in this case 0xFF at 8-bits per channel.
gfx::draw::filled_rectangle(bmp,bmp.bounds(),color_type::purple);
This line should fill m_frame_buffer appropriately with like 0xFF 0x00 0xFF 0xFF like that. (or similar, I actually don't know what the X11 values for purple are off the top of my head)
honey the codewitch
13-Sep-23 10:26am
View
Oh I'm calling InvalidateRect in my message loop for now.
honey the codewitch
13-Sep-23 9:58am
View
Thanks. I'll give it a shot. I meant Direct2D, and yet always type DirectDraw because I learned DirectX ages ago, and the old tech stuck. I hardly do any windows development at all. Mostly embedded so I don't have much reason to try to retrain myself.
honey the codewitch
29-Aug-23 9:03am
View
sorry! didn't know
honey the codewitch
25-Aug-23 7:44am
View
I have not. I moved on but I still want to find the problem.
honey the codewitch
21-Aug-23 16:38pm
View
that's a good idea. maybe i'll give that shot, though it's a bit involved making one of those fonts from scratch. Perhaps i can modify one.
honey the codewitch
21-Aug-23 14:56pm
View
m_current is const uint8_t*
honey the codewitch
21-Aug-23 14:56pm
View
the seek_buffer is similarly a thin wrapper. I'm confident in the seek code since I use it extensively for rendering straight out of TrueType font files, in maybe hundred projects now. It's rock solid. I think. :~
honey the codewitch
21-Aug-23 11:50am
View
Yes! My terrible self and a bad edit. (I removed some code to post here because it was in the way)
honey the codewitch
21-Aug-23 8:40am
View
I am indeed but it's just this: *in_out_size=stm->read(buffer,*in_out_size); return gfx_result::success;
Edit: I think I just found the bug!
Edit 2: Nope.
honey the codewitch
21-Aug-23 8:26am
View
yeah. It's a simple delegation used to just workaround the fact that my containing class can be const, but a stream read is not const because it changes the cursor position. So I forward to a static method, passing the stream, effectively circumventing the const restriction. It's sort of kludgy, but it's due to a const "polarity" mismatch introduced by the fact that the stream has a cursor. It's just two lines: *in_out_size=stm->read(buffer,*in_out_size); return gfx_result::success;
honey the codewitch
21-Aug-23 8:22am
View
Oh, I'm probably not going to use your workaround, no offense! :). I'm going to find the problem. I can't have this code underneath read_stream() not working properly, as it's mission critical in a lot of projects.
honey the codewitch
21-Aug-23 7:16am
View
Thanks. Exactly what I needed before I went further. Everything you say jibes with what I understand, but the stream code itself is used in professional projects. Yikes. It's never broken before that I know of, and I use it for complicated stuff like streaming TrueType off of a file
honey the codewitch
21-Aug-23 1:08am
View
My bitmap code is such that there is no end of line padding, but yeah I know what you mean. I have to do some acrobatics on an e-paper panel driver i wrote due to that.
honey the codewitch
21-Aug-23 1:07am
View
read_data simply reads from the stream at the last place it was seeked to, and advances the cursor by however many bytes were actually read.
honey the codewitch
23-Jul-23 7:59am
View
Ah thank you. I must have been looking at docs for the old standard. I had been at this stuff for so long at that point yesterday it doesn't surprise me.
honey the codewitch
23-Jul-23 3:50am
View
For reasons known only to K&R NAN and INFINITY are not defined by C. Anywhere. Sometimes, some implementations of math.h provide it, but not on the systems I'm targeting.
Furthermore, while my graphics library does not rely on the STL it is in fact C++14 or C++17 (depending on the headers used). I know people use C++ with ZephyrOS, so maybe this is a zephyrOS question.
Thanks for your response. Basically it confirms for me that this is most likely a GCC vs G++ issue, and not a problem finding includes.
honey the codewitch
8-Jul-23 11:33am
View
I've added some code in What You Tried. I think gets me really close. There may be ways I can optimize it though.
honey the codewitch
8-Jul-23 9:24am
View
The solution I need is actually a lot more complicated than what you described. I really should make something in MSPaint to visualize it but it would be rather time consuming and labor intensive. The issue comes from filling around the existing rects with irregular rects. It's The Tiling Problem, but with irregular tiles (not on the grid) - in fact, the Tiling Algorithm may work if I make the grid 1x1 but it would be inefficient.
Edit: I've added code in What You've Tried that works, but may be made more optimal.
honey the codewitch
8-Jul-23 9:20am
View
your comment got cut off. Maybe "improve" your existing solution with the code. And thanks again. This is getting interesting.
honey the codewitch
7-Jul-23 14:42pm
View
It can allow overlaps in theory, it's just suboptimal as it will draw to the display twice in some areas when once would have done. I can't use Win GDI/+ calls because this is not tied to windows. In fact the codebase is primarily meant for little IoT widgets. It *will* run on a PC, but there's little sense in doing it except for prototyping. That said, my graphics library is, while not quite as full featured as GDI+, it's at least in spitting distance in a lot of ways. The API is very rich, and I can take advantage of it.
honey the codewitch
7-Jul-23 14:32pm
View
there's effectively no minimum but since the idea is to minimize the number of rectangles needed, each rectangle needs to be as big as possible, limited to 32KB in area.
honey the codewitch
7-Jul-23 14:31pm
View
To be clear the pre-drawn untouchable rectangles may be larger than 128x128 in area. It's just fill rectangles where I'm limited to that - the ones i have to create. Other than that yes, that is my issue. Like I said I looked at the tile problem demonstration and description and it doesn't quite fit my problem. Almost, but because it doesn't a different algorithm is needed. Someone suggested a kd-tree might be useful for this, but i don't know. I've only ever used that animal for nearest color matching.
honey the codewitch
7-Jul-23 14:28pm
View
The algorithm isn't sufficient. The reason that I didn't know the name of it is probably because I never went to school for any of this. Being self-taught, there are holes in my knowledge large enough to drive a truck through. Oh well.
honey the codewitch
7-Jul-23 9:37am
View
Thank you for pointing me to the algo. After looking it up: https://www.geeksforgeeks.org/tiling-problem-using-divide-and-conquer-algorithm/ it seems like it almost describes my problem but not quite, because the filled in tiles occupy locations that are regular in size and location - they fit in the grid. My existing rectangles do not fit in a grid, so the algorithm I linked to won't work. I could subdivide into smaller grids so that the existing rects take up multiple grid spaces, but the problem with that is the grid is very small and I'd need to recombine small rects into larger rects, which is a problem in and of itself. Once again, thank you for pointing me to this algorithm, even if it's not quite what I need.
honey the codewitch
7-Jul-23 9:24am
View
It's not quite what I need. The issue is it that it needs to fill in irregular sections that aren't 128x128, but may be 32x200 for example. In your code you simply don't put in the rect if it overlaps. This actually gets me my first pass so your solution is partially correct. Basically what I need is another pass to go through and fill in the blank spots. However, this still won't yield optimal results, but it gets me closer.
honey the codewitch
7-Jul-23 9:18am
View
I'm setting it up in C++ now, with visualization for checking. I'll let you know how it goes. It may be a bit, as I'm still waking up, drinking coffee, and poking at it periodically at the moment. Thanks again. :)
honey the codewitch
7-Jul-23 8:52am
View
I'm plus +5 ing this for the sheer effort. It may solve my problem but I need to try it. It certainly looks like it works. It will take a minute to test everything so I am accepting this solution in the interim to keep people from posting more solutions. I may reject it after-the-fact if it doesn't solve the problem. No matter what happens, thank you very much for this.
honey the codewitch
7-Jul-23 8:49am
View
Yeah. Only thing is the rect locations aren't technically random, but they are for this purpose. IRL they are laid out controls.
honey the codewitch
6-Jul-23 9:59am
View
yeah. sorry. all the equality types in JS make me cross-eyed. ha!
honey the codewitch
6-Jul-23 9:58am
View
I think it is! I just couldn't see it. I'll test it, but mark this as solved, because I'm 80% sure you just unstuck me.
Actually I think it's: return (m_buffer_size * 8 + 7) / typename bitmap_type::pixel_type::bit_depth;
But close enough! The purpose of +7 is basically the same as ceil() on the result of the division, were it floating point. That way 9 px at a bit depth of 1 takes 2 byte, not 1 byte. :)
Edit: Wait. I think this is wrong. meh.
Edit 2: No it's right.
honey the codewitch
6-Jul-23 9:55am
View
Is that JS? The triple equals is throwing me off. I'm assuming it's the same as == in C++
honey the codewitch
27-Jun-23 11:42am
View
This is the only place new or delete are being called, in the shown code. this is on ESP32s and SAMD51s, not ARMs. I don't have a debugger on these devices. Even JTAG is too slow to be usable. Besides, I'm not getting a stack dump. I'm getting a hang. And only on devices with a certain type of LCD display bus.
honey the codewitch
26-Jun-23 20:03pm
View
Those copy constructors are never getting invoked in an instance where it would create an invalid linked list. That much is tested code. So the delete code works correctly. Every next pointer created is valid until segment_clear_all() at which point none are.
honey the codewitch
22-Jun-23 19:42pm
View
It kind of depends on what you mean by "copy". Both ways are valid C++, but the kind of copy it is is a little different. If I copy a segment that's linked to segment B, then there will be two segments leading to segment B. That's an invalid link list of course, even though the copied instance is valid which owes to your concern, but the way this copy constructor is used that will never be an issue. Good eye though. :)
honey the codewitch
22-Jun-23 14:27pm
View
thanks. yeah i could put that in to make it more explicit but it's essentially already checked by other if.
honey the codewitch
4-May-23 10:01am
View
Yes. I run make clean before I build. I got it working using an older version of the actual toolchain - not changing the build scripts at all. I still don't know why though, which is why I'm leaving this open.
honey the codewitch
28-Apr-23 7:20am
View
It's possible, but I have some difficulty assuming that because xboot is widely used for AllWinner chips (at least by Chinese folks), and I've had a heck of a time running down information on using it. Hard to search google in Chinese, at least for me. I'm going to try this on my VM again. I remember it worked there. It's less than ideal, but maybe it will give me some insight if i make with -d and compare the results. Gonna do it once I feel up to tackling it.
honey the codewitch
27-Apr-23 12:53pm
View
That's a good question. I assumed it was omitting something but I think you're right, that's the full path. Now I'm wondering why it worked before. I may have to unpack xboot again
honey the codewitch
27-Apr-23 10:17am
View
i just added the final part of the output to the question
honey the codewitch
27-Apr-23 8:55am
View
I used strace and I can't figure out what this line means
make[2]: /home/honey/arm-gnueabihf-gcc: Permission denied
Is it trying to execute the directory?
honey the codewitch
27-Apr-23 7:43am
View
I've tried strace, and I don't remember the result because it was when I first ran into this problem. I'll try again
honey the codewitch
27-Apr-23 7:43am
View
Here's a sample. It all looks like this (there's a lot of it)
-rwxr-xr-x 1 honey honey 10392 Jul 1 2021 FrameDecorator.py
-rwxr-xr-x 1 honey honey 1577 Jul 1 2021 FrameIterator.py
-rwxr-xr-x 1 honey honey 6758 Jul 1 2021 __init__.py
drwxr-xr-x 2 honey honey 4096 Jul 1 2021 command
-rwxr-xr-x 1 honey honey 8031 Jul 1 2021 frames.py
drwxr-xr-x 2 honey honey 4096 Jul 1 2021 function
drwxr-xr-x 2 honey honey 4096 Jul 1 2021 printer
-rwxr-xr-x 1 honey honey 10913 Jul 1 2021 printing.py
-rwxr-xr-x 1 honey honey 4209 Jul 1 2021 prompt.py
-rwxr-xr-x 1 honey honey 5530 Jul 1 2021 types.py
-rwxr-xr-x 1 honey honey 3137 Jul 1 2021 unwinder.py
-rwxr-xr-x 1 honey honey 11077 Jul 1 2021 xmethod.py
honey the codewitch
22-Apr-23 11:27am
View
That could very well be, but we also can't offer the things a lot of other outfits can. We're kind of a shoestring outfit. I'm not sure how much we could raise our rates and remain competitive.
honey the codewitch
21-Apr-23 16:03pm
View
It varies, but we're trying to keep it flexible, so the idea is compact, modular, and relatively inexpensive. How compact? Dunno yet. How cheap? < $50 to manufacture the main "brain" (not including the modules), another $20-$40 for a screen. None of these prices are bulk. That way we don't have to make a ton of different devices to meet a bunch of needs. Based on the projects I've done this main brain can handle anything I've had to do for a client by a factor of 10x. I need 100mhz. I have 1Ghz. I need 512KB RAM. I have 512MB. The only thing I'm kind of lacking is flash space, but I could use SD internally for gigs of space, which i may do if I can make it reliable.
honey the codewitch
21-Apr-23 12:37pm
View
It's not the cost exactly, but the payment structures that concerns me. I charge for deliverables, so I don't want to push recurring costs onto my clients unless they have a specific service need for their project.
As far as chips being swapped that's the problem. These ARM based SoCs are so diverse every single one is going to have different registers, if not a different footprint because they have different on-chip peripherals.
I think I've found a solution in the allwinner H616 even though it's meant for TV boxes like making a Roku knock off. It is Cortex A53 based w/ HDMI which is what I wanted.
Here are my notes on this solution. If you want to take a look and offer your input I wouldn't mind, but no obligation
https://pastebin.com/4p0HWAKB
honey the codewitch
12-Mar-23 12:10pm
View
This is a dual core 240MHz proc with about 360KB of usable SRAM. I am using TTF because frankly, it's the quickest and dirtiest way to get anti-aliased fonts onto my screen using the libraries I'm using, and gives me the option to scale to different displays if I want to support different hardware. If I was super concerned about performance in this instance, I could prerender to a bitmap, but you run into perf issues anyway due to blending required for kerning.
Edit: In my LVGL TTF lib I do glyph caching so what you're talking about happens in the background, but I haven't implemented that for htcw_gfx yet.
honey the codewitch
12-Mar-23 11:44am
View
You're leaning me toward that option. The screen isn't very wide or I'd have considered doing what you say, but I have maybe a dozen characters left to right - i haven't counted yet, or rescaled the font or anything just yet. My app in fact, computes the max column count based on the size of the display.
honey the codewitch
22-Feb-23 14:17pm
View
As best as I could visually verify yes. I did similar. I'm closing this solution as solved because I'm near certain the bug is coming from my rendering routines. Maybe deep in my graphics library, brought about because of negative coordinates off the top of the bitmap. It *should* clip, and draw appropriately but it seems it's not. I think it might be due to converting something from signed to unsigned without cropping it first.
honey the codewitch
22-Feb-23 10:14am
View
I'm keeping this solution open pending further investigation because I've tried it and it's not working but now I think the bug is probably somewhere else. Thanks for finding that 1 pixel bug =) Fencepost errors are irritating.
honey the codewitch
22-Feb-23 6:31am
View
See, the problem is I get ambitious and then things like the OP happen. :(
honey the codewitch
22-Feb-23 6:24am
View
m_controls holds a vector of controls sorted by z-order, back to front. The screen background is redrawn with bmp.fill(...) in the code.
honey the codewitch
22-Feb-23 6:23am
View
The problem with asserts on this platform is you don't get a reasonable debugger (JTAG makes you want to get out and push) - asserts will create a boot loop which actually makes things harder to debug. Better to dump to the serial port, or failing that, while(1); the damned thing after dumping a message to serial. I'm dumping to the serial for this, but I'm not 100% sure what to expect so I have nothing to feed an assert.
honey the codewitch
22-Feb-23 6:21am
View
I hate this. You don't know how many times I've run into questions I can barely ask, much less find someone who can help with the answer.
honey the codewitch
22-Feb-23 6:20am
View
It would be twice as much code to abstract this time critical function, and designing an interface between high and low level would be almost as difficult as creating this.
honey the codewitch
22-Feb-23 6:20am
View
The algorithm already does that. It's the second part of the routine.
honey the codewitch
22-Feb-23 6:19am
View
Each control has an invalidate() function that marks it for add in the dirty rectangle list built at the start of the routine. I don't offset in the render routine of each control. I offset all draws in an intermediary canvas of type control_surface_type which sits over the bitmap and offsets all drawing operations. All drawing operations to a bitmap are automatically clipped to the bitmap. None of this is my issue. It's just positioning.
honey the codewitch
22-Feb-23 1:20am
View
Yeah. I understand. I just ate a BLT and intend to nap. Maybe a solution will present itself that way.
honey the codewitch
24-Dec-22 21:25pm
View
Hey, whatever works
honey the codewitch
24-Dec-22 11:18am
View
No problem at all. Glad to help. I love little C++ brain teasers =)
honey the codewitch
29-Nov-22 5:00am
View
Thanks! I've kind of answered my own question since I asked it - funny how that seems to work so often, but now I'm interested in what others have to say. =)
honey the codewitch
30-Aug-22 12:02pm
View
code generation is not a library, nor can a minimal IoT device function with a UI library on battery power.
honey the codewitch
30-Aug-22 9:19am
View
Yeah. I've been coding since 1986, professionally since 1996, so I hear you.
honey the codewitch
29-Aug-22 11:16am
View
I can't have it all, but I can endeavor to have the important stuff. I have a pretty solid instinct for when the design crystalizes and I can move forward with development, and I just haven't banged on this design enough yet. I'll figure something out that gives me everything I actually need, and I have the time to drag this out if it means getting it right.
honey the codewitch
29-Aug-22 11:13am
View
You're not wrong. In fact, I was thinking about a fixed scheme like you mention, and on reflection I realized that I would know how many widgets there were in advance. But runtime modification of said widgets is where I run into trouble. For example, as soon as I make it so you can change the text on a label at runtime, the complexity gets much higher. The reason being is I have to switch from laying things out on a screen by screen basis, to an "window/control" by "window/control" basis, and that means computing dirty rects and stuff, or using a painters algorithm on a godawful slow device.
At least that's where I'm at with my thinking now. I still haven't decided, because I'd prefer (A) if there was a good way to skin that cat, but (B) seems to be what I am leaning on in absence of that better way, so maybe I just need to spend some more time thinking about (A)
Edit: Hahaha I even swore in my comment. Now you know where my head is at.
honey the codewitch
26-Aug-22 10:52am
View
That's good advice for desktop apps, but "general purpose library" and IoT are generally at odds with each other. Every abstraction costs, and when you're dealing with 80kB of RAM and < 100MHz sometimes it matters. Also, projects can't be very large on most devices.
I'm wondering if there isn't a way I can separate the generated code from application code that uses it, sort of like Microsoft's code-behind paradigm. That might give me the best of both worlds.
honey the codewitch
16-Aug-22 11:00am
View
That can't happen because of the way these streams work. buffer_size will always return buffer_capacity except for the final block, after which it will always return zero. Therefore, it never hangs. And yes, a while loop would be better, but I learned something in martial arts that serves me here - first get it done, then do it quickly. Anyway, I found the bug, and it wasn't in this code. Of course. Thanks anyway.
honey the codewitch
31-Jul-22 16:01pm
View
The buffer logic implementation is almost all in read(). That's what gets me. That's what does all of the heavy lifting, and as far as the underlying stream, I've tested it. It works flawlessly when I feed it directly to the downstream consumer (a jpg loader) but when I add the buffered stream it croaks. Interestingly, it works for loading TrueType font streams, ***but.. TrueType font streams seek all the time, which resets/clears the buffer, so it's effectively not using the buffer. Just some background.
honey the codewitch
31-Jul-22 12:33pm
View
I'm pretty sure this is correct (I'm using gcc) but I can always break it out into a full if.
honey the codewitch
31-Jul-22 12:32pm
View
It actually is recursive, but it recurses only in the case where the requested amount is greater than the buffer capacity. m_stream is the underlying stream.
honey the codewitch
24-Jul-22 10:29am
View
Yeah I solved it this way earlier thanks to Peter. I just wasn't able to come at the problem the right way. Funny how something so simple can get so complicated.
honey the codewitch
24-Jul-22 10:28am
View
Whoops. my reply was meant for Griff
honey the codewitch
23-Jul-22 19:21pm
View
You're overcomplicating it. The hardware is doing the timing. I am sampling at 44100Hz. With that in mind I am computing a sin wave based on a rolling phase that is a derivative of that sample rate and the specified frequency. const float delta = TWO_PI*frequency/sample_rate;
I then use that delta to increment my phase between 0 and TWO_PI by delta each time, generating a sort of sawtooth that I apply f=sin(phase) to to get my wav. The *only* reason I can't generate that as a triangle given what I know how to do is because the phase is a saw rather than cycling up and down and up and down. But the sin *does* cycle up and down, so I was hoping I could use that. My square wave is just f = phase>PI; So I don't know. I want to get a triangle by deriving one of those.
honey the codewitch
23-Jul-22 17:58pm
View
Oh okay. I *think* I get it. Time to go get dangerous.
honey the codewitch
23-Jul-22 17:47pm
View
but if i add up the square waves they will compute a tri wav at a much lower frequency and much higher amplitude. The amplitude I can scale, but the frequency issue is problematic. I was hoping I could just "straighten out the curves" in the sin wave and work from that. Barring that, I'd need to bisect the square wave. Computing tangents I guess would work? But I'm not great at math. I was in my 20s before I learned that trig was based around triangles. *hides*
honey the codewitch
6-May-22 13:33pm
View
When you're compiling for little devices -Os is in effect on GCC.
honey the codewitch
6-May-22 8:51am
View
*facepalm* I forgot that shift left and shift right are endian dependent. stupid stupid stupid. i know better.
honey the codewitch
6-May-22 8:42am
View
that's weird to me, because Most significant would refer to the value that affects the high numbers, and Least significant would be the value that affects the low numbers no? That would be different for machines of different endian types, unless I'm missing something. It's frightfully early and I'm still catching up on coffee.
honey the codewitch
6-May-22 7:53am
View
It shoves the bits high if it's little endian - as seen by the shift, otherwise it shifts them low.
If it shifts them high, is that MSB or LSB? That's what I'm trying to figure out. Right now I call it MSB
honey the codewitch
6-May-22 7:18am
View
I'm confused. "Take, for instance your msb function (I didn't scrutinize the other ones), it takes value and stores it in the second byte of value16 on a little endian machine."
Masking off the 8th bit is part of the midi spec.
That's what it's supposed to do. My only question is is that LSB or MSB?
honey the codewitch
6-May-22 0:04am
View
That's not my question though. I already do those checks at compile time. Those ifs are not evaluated at run time.
What I want to know is if my msb() and lsb() accessors are named correctly from big endian perspective, or if I have them backward
honey the codewitch
2-May-22 8:38am
View
As long as it's clear, I'm cool with it. I do weird things like that too. :)
honey the codewitch
2-May-22 8:01am
View
Nope. It's shorter. I'm increasing the top y value, so it starts further down the screen, and since y2 is unchanged that makes the rectangle less tall. I swear to you it works, I'm looking at it running right now. Remember that all the rectangles are effectively anchored to the center on their bottom edge. That might be an area where I should clarify what I'm doing.
honey the codewitch
2-May-22 7:45am
View
Thank you for your feedback! GFX is targeted more toward intermediate to advanced developers and those that actually do IoT for work like I do so some familiarity with "real"/modern C++ is assumed. Basically once you've graduated from Arduino IDE and want to do something more powerful - like utilize the capabilities of that fancy ESP32 you just bought, then GFX is the way to go. LVGL is comparable featurewise, though I don't provide widgets, and I *do* provide full TrueType support, even under Arduino. LVGL can support truetype in limited instances, and it uses gobs of RAM and the firmware must be compiled on a linux machine. Also only targets the ESP32 WROVER. Mine targets whatever GFX does. =)
honey the codewitch
2-May-22 7:42am
View
First, GFX doesn't work with the Arduino IDE because it won't compile with C++11. I use the platformIO IDE with it, which runs inside VS Code so you get all that autocomplete goodness, and just far more control over your project builds than you can get with the Arduino IDE.
Spoiler on the code:
Yeah, the clock basically forces the rectangle you pass it to be square by looking at the shortest edge and treating that as both the width and the height. That's what w is.
Then it *is* centered. horizontally. See, all hands are drawn effectively at the 12:00 position (before rotation), and then rotated based on the corresponding time figure.
Notice the center of the viewport is set at the beginning. That means the rotation will be around that point. =)
honey the codewitch
2-May-22 6:35am
View
What I'm trying to do is create examples for people that don't read the documentation.
A lot of times people that use arduino are hobbyists and don't RTFM.
Assuming autocomplete, and the above, can figure out what it's doing from the context?
Not necessarily precisely - just imagine you're looking at a code sample to figure out how to do something. How hard is this one to figure out enough to fiddle with it, if that makes sense?
honey the codewitch
2-May-22 5:44am
View
hahaha I had changed the order above after-the-fact for readability and it's early. I fixed it.
honey the codewitch
25-Apr-22 6:54am
View
That's what I thought too so I recloned the git in a separate project. Same deal. I also am manually checking the compiler error line # with the line # shown by VS Code and it matches.
I'm starting to think there's a bug in the GCC compiler? I need to rename my variable again to see if I wasn't hallucinating.
honey the codewitch
25-Apr-22 6:53am
View
it's just a temporary holder for an error return value. Typically for things like this I use one letter names. It actually makes it clearer because it's easier to scan visually what is "throwaway" and what is part of the actual algorithm.
There are two reasons I know I'm not looking at the wrong code. For one VS Code provides line #s and click to jump to the location of compiler error messages. I've also manually verified.
honey the codewitch
19-Apr-22 18:05pm
View
I wouldn't be surprised if it's off. I was actually trying a number of things. CPallini caught a show stopper for me that explains why i got nothing.
honey the codewitch
19-Apr-22 18:04pm
View
I shouldn't said the thing about the top left. I want the colors to start at the start color and radiate away from the center point where the start color is, toward the extents of the rectangle, where at least somewhere, end_color should be represented. This is actually easier to do spherically, but I want to do it so it is along an imaginary line instead of radiating away from a point, if that makes sense.
honey the codewitch
19-Apr-22 18:01pm
View
If rect.y1>rect.y2 xd will be -1, oooooh thank you. I just saw it.
honey the codewitch
19-Apr-22 15:49pm
View
I learned a long time ago to first make it work, then make it work fast. It serves me well, except if there are design issues tied up with performance. The blast radius of any design changes are limited pretty much to this routine, so if i have to rewrite it for performance I will. I wrote this to try things out, and I didn't want it too laden with premature optimizations.
Edit: Looking at your solution, it's too simple for my application, as it only does a gradient in one direction, not at arbitrary angles with arbitrary starting points.
Pixel blending by channel is something my library already does when you call blend.
honey the codewitch
1-Apr-22 8:40am
View
Have you considered studying? Imagine you "earned" your degree by way of other people and landed a programming job. Are those other people to do your work for you as well? Maybe if you're going to school, take advantage of it.
honey the codewitch
26-Mar-22 21:59pm
View
Yes that would be correct. As far as your solution, I'll have to think about it. It does give me an idea. There's a chance it will complicate another part of the code and right now I'm too foggy to determine whether it will without diving into it.
honey the codewitch
17-Mar-22 3:29am
View
That's one of the reasons I haven't really bothered doing much fixed integer arithmetic. There is one area in that routine where it does, but it makes sense to because it's just blending RGB888 color channel values.
honey the codewitch
16-Mar-22 18:12pm
View
Yeah unfortunately optimizations like this won't take my minute down to seconds, which is what I need. I need orders of magnitude of performance improvement.
honey the codewitch
16-Mar-22 14:19pm
View
Starting at line 573 here
https://github.com/codewitch-honey-crisis/gfx_demo/blob/master/lib/gfx/include/gfx_palette.hpp
the tables are here: https://github.com/codewitch-honey-crisis/gfx_demo/blob/master/lib/gfx/src/gfx_palette.cpp
I'm using "mixing_plan_fast" although I have two.
Sorry for the length and interdependencies. This code is not really user friendly.
honey the codewitch
11-Mar-22 13:04pm
View
That's basically where I'm at right now. I'm going to keep this open to see what other ideas there are out there before I put a lid on it. Just in case there's some cleverness yet to be mined kicking around in someone's head.
honey the codewitch
11-Mar-22 4:45am
View
I totally didn't even see the link when i first read the question. must have been having a day.
honey the codewitch
10-Mar-22 13:23pm
View
I second PIEBALDconsult here. Where is your stream coming from? If it's coming from a network source Peek() will fail. You really shouldn't Peek() if you want your code to be robust. Use Read() and just keep a copy of the current character around in a variable instead of using peek.
honey the codewitch
8-Mar-22 17:17pm
View
Earlier there was an error in my question. I tried two different ways, in the question, and have settled on this
(R-R2)
2
+(G-G2)
2
+(B-B2)
2
See the edit to the question. The code was right, but my description of what i was doing was wrong in the question before I edited it. Sorry.
Edit: It turns out it was an unrelated bug. My color matching code worked fine.
honey the codewitch
8-Mar-22 16:27pm
View
I'm working on figuring that out. I had to take a cat nap =)
Edit: I've edited my question significantly to update where I'm at.
Edit 2: There was nothing wrong with my code to begin with. It was an unrelated bug.
honey the codewitch
8-Mar-22 15:19pm
View
And I did check it. Turns out the formula in my question is wrong, but in the code it isn't. I use a variant of the Euclidian method sans the final sqrt() since I don't need it (i'm only comparing relative distances so if i sqrt none of them it's the same as sqrting all of them). I've since updated the question with the proper formula. thanks for catching that. unfortunately it doesn't fix my code. =/
honey the codewitch
8-Mar-22 14:47pm
View
the first method is a variant of the Euclidian distance method. The final sqrt is removed as it's not necessary in this case.
... and as I was typing this I realized I was doing it wrong above compared to the wiki.
so thank you for probably solving my issue, albeit just by making me check my work.
honey the codewitch
6-Mar-22 19:31pm
View
The problem there is I need to friend the other way around, and I don't have all the template arguments.
honey the codewitch
5-Mar-22 12:21pm
View
This is the Arduino framework. setup() is the entry point, and loop() is called repeatedly by the framework for the life of the app once setup exits. There is no exiting "main" - main is implemented as main() { setup(); while(true) loop(); } basically (simplified)
honey the codewitch
8-Jan-22 1:03am
View
Happy new year to you as well.
honey the codewitch
8-Jan-22 0:38am
View
Yeah, I'm not trying to execute the regular expressions. I'm trying to simplify and compact them programmatically.
honey the codewitch
7-Jan-22 8:25am
View
I should have clarified. This is DFA regex. No backtracking constructs. I can already convert to a regex string from a state machine. this is only about simplifying the result.
honey the codewitch
7-Jan-22 8:25am
View
Deleted
I should have clarified. This is DFA regex. No backtracking constructs. I can already convert to a regex string from a state machine. this is only about simplifying the result.
honey the codewitch
25-Dec-21 1:28am
View
You're not hearing me. Even if I provided you an example, you would not understand it, and so it wouldn't benefit you. If you were to use it, you could not maintain that code, and I'm not going to maintain it for you.
Therefore I will not give you that. It would be like giving someone my loaded gun.
This is not something you should be trying before you even understand even the basics of how to code C++. Learn how to code some C++ first.
honey the codewitch
24-Dec-21 19:54pm
View
It's because you're using cdecl as your calling convention. And how is C# supposed to know the size of your array? You'll have an easier type using stdcall as your calling convention, and yielding an out pointer to the array and an out pointer to the size of the array for your function.
your C++ code is invalid anyway. Anything you declared in the function goes away once the function is complete, meaning you're returning a bad pointer.
Also using unsafe code in C# is inadvisable, because unless something changed, it tends to require full trust, so it won't run unless it's installed in a particular way on the target machine.
I'm going to be very frank with you. You are swimming way out of your depth right now. Learn C#. Learn C++. Then learn how to use them together. Right now you don't know any of them, except maybe some C# from the looks of things.
honey the codewitch
14-Dec-21 13:52pm
View
It's baking my noodle. I'll hit you up if I have questions. I'm not accepting just because I want more ideas but I'm +5ing your solution. :) Thanks.
honey the codewitch
8-Dec-21 13:59pm
View
I'll look into that, thanks.
honey the codewitch
7-Dec-21 11:10am
View
Totally. This code flips physical digital pins on a chip high and low, which it needs to do fast and precisely timed, because it's a driver for an 8-bit parallel bus attached to a (usually color) LCD or TFT display. The frame rates I can achieve with graphics draws are directly tied to this code.
honey the codewitch
7-Dec-21 9:10am
View
Hmmm.. It seems a bit sloppy to me because I don't like the idea of introducing arbitrary template arguments just to templatize a function. The code smell, you understand. If I come along in 6 months and every function is templatized with dummy arguments, I don't what I'd do. I think I'll stick with the __attribute((always_inline)) route suggested before, because I'm targeting GCC specifically.
honey the codewitch
6-Dec-21 18:13pm
View
That could work, so I'm accepting it, since I wasn't familiar with the attribute prior. I'll give it a shot. I have to optimize for size. I'm not even sure how my toolchain would react otherwise, I just can't afford the extra space, particularly on STM32 boards. I can't use clang because my toolchain relies on GCC and I don't have any control over that. Actually all my IoT toolchains require GCC at the moment.
I do like to compile with both clang and GCC (when i'm not doing IoT-only) but GCC is my primary target.
honey the codewitch
20-Nov-21 5:33am
View
I'd have suggested they continue to ask the question until their code magically works.
honey the codewitch
15-Nov-21 13:31pm
View
Why did you take a job you're not qualified to do?
honey the codewitch
10-Nov-21 11:54am
View
Can you post several example strings, with example matches you'd like to see?
List several variations of this (including one with no matches)
And then below each one, list on a separate line each substring you'd like matched.
AB-0001234/00005-Testing My Regex hereAB-0004567/00007-Second Testing of my regex
--- matches ----
AB-0001234/00005
AB-0004567/00007
Second
Testing
(assuming you also wanted to match Second and Testing - i know you don't, i'm just trying to give you an example)
Anyway, make at least 4 of those, including one with no matches, and I bet you'll have a better time getting an answer.
honey the codewitch
9-Nov-21 22:35pm
View
Thank you! That clears it up for me perfectly.
honey the codewitch
5-Nov-21 5:02am
View
That was my original plan for Python. I just wasn't sure if it was valid. Actually right now I think my multiline conditionals are indented once rather than twice but it's an easy fix in my generation template. the big issue is knowing what's valid, and secondarily what's pretty. I'm on the fence about double indenting multiline conditionals hanging off of ifs. It's prettier to corner case it, but I don't like it because it's not consistent with the general rule of indenting I follow through the rest of my code. It just rubs me wrong.
honey the codewitch
5-Nov-21 4:34am
View
Not in that case, but there are other cases where it's needed. It makes code generation a bear. Fortunately in my current case the blast radius of this problem is limited to if () statements.
honey the codewitch
5-Nov-21 3:08am
View
Thanks, I totally blew by the link in the reply. It's the hour that it is. I'm not altogether with it right now. =)
honey the codewitch
5-Nov-21 1:29am
View
Are you sure it's not indented at the next level? My google fu isn't helpful right now, and I don't want to stop what I'm doing to start an install of that mess. Oh well. I'll figure it out one way or another. Thanks.
honey the codewitch
11-Jul-21 11:55am
View
I can't target C++20 unfortunately. I'm limited by the minigw gcc version used by platformIO under windows (the least up to date build platform) and that means C++14
honey the codewitch
11-Jul-21 11:54am
View
> Can't you just say that instantiations must include various has_blah functions
In some cases, maybe if I had designed it that way. However, because things are typed to a pixel definition and other things, you can't use bool functions for every case. You have to use usings in some cases. Since I already have a using for this case, I find it inelegant to require the draw target implementer to create function to say essentially the same thing.
honey the codewitch
11-Jul-21 8:28am
View
I have an idea though. I'm wondering if I can't go template<typename T,size_t NativeBitDepth=T::native_pixel_type::bit_depth> struct test_for_native_pixel_type { ... } or something like that. I don't know what the compiler will do there if native_pixel_type isn't declared. My assumption is that it would error but perhaps it wouldn't. I need to check. It would only be zero if native_pixel_type was not present and the compiler had to choose a default for size_t. It *could* work, i just don't know if it will.
honey the codewitch
11-Jul-21 8:21am
View
I have "draw destination" classes which are loosely defined (bound via template) and have an interface/contract that includes usings. One of the members might be something called native_pixel_type and if it's present it tells me that "virtualization" is being used which means it's dithering. If it's dithering I don't want to use anti-aliasing to smooth the edges of fonts because there's not a true grayscale to work with, just black and white.
honey the codewitch
25-May-21 11:50am
View
Whoops, I forgot to increment my fill pointer. Not sure what i was thinking. Still, it doesn't solve my issue but thanks for spotting that.
Edit: Never mind. retr() will fill "fill" each time with new data. The y is just there to make sure it gets called the right number of times.
honey the codewitch
25-May-21 10:57am
View
The reason it's defined that way is it's 16-bit color values, but send and retr take a byte array. It's fine - casting does nothing to the data. It only changes how the data is perceived. It is a "pure" operation with no side effects (unless it is overloaded, and in this case it isn't). say you had a 16 bit word of 0xC1A2. If you cast that to bytes you'd have a byte C1 followed by A2 (actually reversed on little endian systems but you get the idea). send and retr deal in BLOBs which are byte arrays, effectively. But it's easier to deal with pixels in their native format, hence the discrepancy there. a 16 bit pixel is R:5, G:6, B:5 so you can't split it cleanly.
As to your second question, each color is 2 bytes. The pixels are 320 across. The compiler will "fold" the value to 640 with no runtime overhead, but defining it this way makes it clearer that it's 320 pixels of 2 bytes each. It's just a way to express intent with code.
honey the codewitch
24-May-21 8:59am
View
If he does, he'll regret it. I didn't post the answer for him. I posted it because it was a good question. I half assumed he'd be kicked for the autism remark.
honey the codewitch
10-Apr-21 7:37am
View
Thanks. I actually tried that after I posted the question, but I had the syntax wrong. I ended up writing a helper function to disambiguate. It's for the best anyway that I did it that way, in the end. Still, this is the proper solution.
honey the codewitch
2-Apr-21 3:19am
View
Prototype it in C and then simply spit the asm out using the compiler.
There's hardly any reason to use an assembler directly anymore, and many good reasons not to, but if you *must* use an assembler, use C or C++ to prototype your assembly code where you can.
The above can easily be written in C, so write it in C, and then use your favorite C compiler to get the assembly from it, and then look at that.
You haven't specified which assembly you want. Are you coding for an ATmega2560, a Tensilica, an ARM, x86?
Don't bother. Just use C and get asm that way. If you want to tune it from there you can.
honey the codewitch
17-Mar-21 12:17pm
View
Okay, it sounds like what you're really trying to do is access something like a control from outside the form it's declared on. For example, you have class a that needs to access an instance of Form.cs. Where is Form created? Because first you'll need that. If it's your main form, it's created in Program.cs in the Main() routine as part of Application.Run().. it calles "new Form()" - you will need the value it returned to access any fields in it. It is simply not otherwise directly possible since that form could be anywhere in memory. Or there might even be more than one of them, or none of them. Without some sort of access to the "pointer" for the instantiated Form you are out of luck. Form is just a class. It's nothing until it's created with "new"
honey the codewitch
3-Mar-21 12:53pm
View
src/vfs.hpp:152:31: error: invalid conversion from 'int (*)(int, stat*)' to 'const void*' [-fpermissive]
memcpy(&test1,vfs.fstat,sizeof(void*));
I can't set the permissive flag because gcc is run as part of a large, complicated toolchain and it doesn't like to be touched.
honey the codewitch
3-Mar-21 12:38pm
View
Yeah i caught that a minute ago. it amazes me i let that go. I've updated the code. it still doesn't compile.
honey the codewitch
22-Dec-20 10:03am
View
I know i know. it's early and i'm sleepy and typos and poorly worded thoughts flow freely from me right now.
Edit: (per yours), Yeah I may need to break out paint!
honey the codewitch
13-Dec-20 11:29am
View
Normally I don't find much occasion to mix them, but I wanted a more compilery, less preprocessory way of defining a maximum capacity for a fixed length array.
I'm not aware of a better solution to the problem than what I've done above, in this particular instance. The code difficulty is limited because the class isn't that complicated. This was one wrinkle, and it was a compiler SNAFU. A good reason not to use it sure *if a better replacement can be had* but I'm not aware of one for this case.
honey the codewitch
13-Dec-20 10:37am
View
Totally. They can be frustrating at times, but Accelerated C++ changed my life and I do a lot of generic programming now. Less so on Arduino stuff but still.
honey the codewitch
13-Dec-20 10:32am
View
nah it should be able to forward precisely *because* it's virtual. there's a vtbl in play so it just needs to find the function.
Turns out the compiler was looking for a global function called initCapture().
Since it's part of a template there's a 2 phase resolution process in C++ and it wasn't picking it up as part of the class.
So if you do this->initCapture() it all works fine. It gives the compiler what it needs to look in the right place (the base class) for the function.
honey the codewitch
11-Dec-20 19:59pm
View
Wonderful! I'm so glad when my stuff can help someone. We all start somewhere. Good luck with your project!
honey the codewitch
11-Dec-20 9:45am
View
unique_ptr takes the type and decorates it so you're creating a pointer to a pointer. Solution 1 is the correct answer.
honey the codewitch
1-Dec-20 7:07am
View
You've said nothing about the problem. You've just mentioned that a problem exists. How is anyone supposed to help you when they don't know the nature of the problem you are running into? "Licensing issues" is not a description of the problem, and most people may not have heard of "black duck scan"
honey the codewitch
30-Nov-20 20:36pm
View
You can't use windows forms in core 3.0. Either way you're going to need to create a window from the looks of it. It might not need to be visible. That, and the code I offered is what I have. If you want to know about TWAIN you'll just have to study it as I don't know anything about it.
honey the codewitch
29-Nov-20 12:48pm
View
Hey thanks. This is awesome! You don't mind if I use a derivative of this code in a commercial gadget do you?
honey the codewitch
29-Nov-20 11:47am
View
Thank you!
honey the codewitch
29-Nov-20 9:23am
View
I can't do it that way because readNextPoint() reads from flash which is very slow. I need to do it one sample at a time to keep things running smoothly, if I can at all.
Therefore if my solution gets me the same as your solution I prefer my way. I actually endeavored to avoid doing it the way you do.
I should add that the number of points is compile-time configurable depending on the defined resolutions so sometimes that loop might be much larger. =)
honey the codewitch
29-Nov-20 8:30am
View
I'm going to add to make it explicit. It appears his data and not his query is the real culprit. I'll also explain INNER JOIN here since he was asking. Inner join simply combines columns from two tables where one or more columns in one table correspond to some columns in the other table (either directly or indirectly through a formula)
honey the codewitch
28-Nov-20 7:53am
View
Beat me to it
honey the codewitch
25-Nov-20 19:34pm
View
I'll have a crack at this after I've had some sleep but what really jumped out at me was it's spelled "vertical" not "virtical" and I'm having a hard time getting past that.
honey the codewitch
20-Nov-20 6:23am
View
This should be in the "Demands" section.
You may have heard differently, but this site isn't full of monkeys that will simply do your bidding.
Perhaps study.
honey the codewitch
15-Nov-20 10:34am
View
ooh that could be fun depending on whats on the other COM ports. :P
honey the codewitch
14-Nov-20 12:47pm
View
I'll say it again: if you have to rely on undocumented functions to release an object, you are doing it wrong.
The proper way to request that a disposable object dispose itself is IDisposable.Dispose().
Disagree all you want, because it doesn't change the facts on the ground. The framework doesn't care about your disagreement, frankly.
honey the codewitch
14-Nov-20 11:37am
View
I'm going to don my software architecture hat for a moment to say if you need to use undocumented functions to free objects you've been doing something terribly, terribly wrong in the first place. Take a step back and retrace how you got here, because you made a wrong turn. There are so many reasons not to do what you are trying to do. It's a large flaming anti-pattern.
honey the codewitch
13-Nov-20 11:20am
View
I know it's kind of not, because Ints can interrupt anywhere, but (maybe not with the ESP32) when an interrupt is called the other code is suspended, which is why i said it's single threaded for the purpose of the code. I may have been making a bad assumption about the value of timestamp, but above is what i meant by consider this single threaded - there's no other code running at the same time, but yes i know it can pull an interrupt anywhere.
honey the codewitch
13-Nov-20 11:17am
View
That's great to know. I am still brand new to the ESP32, and fairly new to the Arduino and ESP8266 modules as well, but I've at least built several things with the arduino, and ESP8266s so far.
honey the codewitch
13-Nov-20 8:32am
View
I'm a member of the ESP32 forum on reddit. I looked there first but didn't see anyone posting code, so I figured I'd try here first. Wasn't sure how they'd feel about blowing up their forum with all that source.
honey the codewitch
13-Nov-20 8:26am
View
Ah yeah I reread it and you're right. Still, the code shouldn't hurt. The 3rd solution was the fix.
honey the codewitch
13-Nov-20 8:25am
View
BRILLIANT! Thanks so much!
honey the codewitch
13-Nov-20 8:23am
View
I'm not sure the standard library is available on arduino's devkit but i'll try this. Thanks.
honey the codewitch
13-Nov-20 5:15am
View
It doesn't assume that, or rather, the assumption is safe, since loop() would simply skip the timeout check on that iteration.
Also, for the sake of this question, consider the code single threaded.
honey the codewitch
13-Nov-20 4:47am
View
Ummmm, ish? AFAIK all the code seems to be single threaded, and yet the thing is dual core. Also it was said I needed to use volatile on global vars accessed within interrupts like callback which suggests some sort of concurrent access I think. I didn't mark _timestamp with volatile above but i have to no avail.
honey the codewitch
13-Nov-20 4:43am
View
Read the code and read the comments in the code. millis() doesn't work in that routine
If you see loop() routine
// for callback(): if (!_timestamp) _timestamp = millis();
That indeed resets the timeout. The comment is correct.
honey the codewitch
15-Oct-20 14:22pm
View
You're creating exactly what I'm talking about. Don't worry about it. =)
I meant the best thing is have all the hacks behind something as "clean" as you can create, but it sounds like you're doing that.
honey the codewitch
15-Oct-20 14:21pm
View
I should add, EnumWindows() and its derivatives don't give you a stopping condition. They will keep calling you back with windows until there are no more but you won't know when there are no more because it will never tell you. I rig a timeout for it.
honey the codewitch
15-Oct-20 13:59pm
View
About the best you can hope for is make a facade out of this and expose an API for it so you don't pollute more of your code than absolutely necessary.
honey the codewitch
15-Oct-20 9:49am
View
I think you should try your next approach. It's what I would have suggested. Keep in mind you're trying to interact on some level with an app that wasn't designed to interact with your app so anything you do is going to be somewhat ugly. Windows has crappy window finding APIs - that's the bottom line. Usually an app will be designed for interaction and they will publish an API into the Running Object Table, obviating the need for window based interaction. Even if they relied on windowing for IPC the server app would publish its window in some way known to the client so the client knew how to get to it later. You don't have luxury. Given all that, you're on the right track.
honey the codewitch
2-Oct-20 15:33pm
View
Presumably you have a reason you'd like the order preserved but the JSON spec does not guarantee the order of named items - that's what XML is for. Basically what you want is to hack the JSON protocol to meet your requirements. Not that it can't be done, but know that what you want to be doing is a hack.
honey the codewitch
24-Sep-20 13:05pm
View
I'm not going to remote desktop with you, sorry. I don't have any more time for this right now anyway.
honey the codewitch
24-Sep-20 12:07pm
View
okay, fair enough. i'm having trouble tracking down where the bottleneck is then.
If calling Reader() from another thread didn't solve it, and if the bottleneck is not that Api() stuff you're doing (which looks a whole lot like a COM port read) then I don't know where your bottleneck is in your code, and since I cannot run the code I cannot find that out.
honey the codewitch
24-Sep-20 10:54am
View
I found the problem I think. I can't test it though. I think your bottleneck is either your USB or COM port (whichever you are using).
I can keep a form responsive for you, but as you said that doesn't matter. What matters is you need to be able to submit to a database while other card reads are occurring.
Here's your problem - you don't have enough bandwidth. If it's USB, you need more than one bus. If it's a COM port you're going to need a lot more of them if you want to do a lot of concurrent reads.
Going through your code, indeed, firing the Reader() method on a separate thread will keep the form responsive but it will not make the reader hardware more responsive.
Especially if you're using a COM port, there simply isn't enough bandwidth
honey the codewitch
24-Sep-20 5:56am
View
Yeah, it turns out, it needs an entire rewrite.
Your code isn't usable. So I'm trying to reverse engineer the Api you have for hardware I don't even own. Be patient
honey the codewitch
22-Sep-20 10:53am
View
And multithreading is not really something you want to be doing after two months.
It's like doing an engine/motor swap on a car right after learning to change the tyres/tires
I'm going to see if i can rig up something for you that avoids it
honey the codewitch
22-Sep-20 10:52am
View
okay. i'll look at it. here's a temporary email address i'll look for it from
honeythemonster@mail.com
Show More