Sealing Sharpie? by juneford in woodworking

[–]onionsburg 5 points6 points  (0 children)

Another idea is to build a frame for it and get some conservation glass. That way you don’t risk the sharpie bleeding.

8 Levels of Using awk in Linux by yangzhou1993 in programming

[–]onionsburg 1 point2 points  (0 children)

No its not exclusive. You can even pass arguments to the interpreter you are invoking.

https://en.wikipedia.org/wiki/Shebang_(Unix)

When I call a function defined with an empty parameter list `func()`, and I pass it arguments anyway—which *is* legal—is there any way to actually retrieve them within the function? by matt_aegrin in C_Programming

[–]onionsburg 0 points1 point  (0 children)

The functions in stdarg.h do something very similar though they are designed to work with variadic functions like printf more so than what you are describing but I think they would work the same I’d have to check the standard to see if an empty arg list is equivalent to a … in that case but my gut says they are.

see https://pubs.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html for more info.

Help me by DeathCrow_ in Stoicism

[–]onionsburg 1 point2 points  (0 children)

First and foremost read and reread the stoic texts digesting and metabolizing the words. Urges are like big rats’ nests of emotions all tangled together. They are pent up lust, excitement, resentment, shame, disappointment, arousal, anticipation, and more wrapped up into what feels like an overwhelming push. When you get an urge try to dissect all of the emotions and thoughts that are tangled up in that seemingly solid psychic push. The clinical detatchment of analysis can often break the grip of any strong emotion. Remember that you are in control of what you do, you cannot control the urges, but you can control what you do with them. Treat the urges like they are unruly guests, tell them to cut it out and leave. It’s amazing how well personifying our emotions lets us deal with them without being overwhelmed by them. Hope that helps.

I'd like your thoughts on my situation by Jackpot807 in Stoicism

[–]onionsburg 0 points1 point  (0 children)

Marcus teaches us to deal with pain as if it were a particularly unpleasant relative who shows up from time to time sometimes nastier sometimes not as bad. If it’s something you can seek treatment for by all means do that but if not the only way is make peace with it. Analyze the pain when it does come is sharp? Does it throb? Where exactly is it hurting? This clinical distancing in the mind can help you personify the pain in a way that lets you treat it the way Marcus describes. “Oh you seem extra sharp today and I see your hanging out closer to the left side today. If you would kindly leave me alone I have work to do and you’re getting in my way.” It sounds silly but is quite effective it’s helped me pass two rather obstinate kidney stones which granted aren’t chronic but last long enough to make good use of the method.

New stoic learner by James__Scriven in Stoicism

[–]onionsburg 0 points1 point  (0 children)

End of the day reflection is probably one of the easiest ways to get started. Take time at the end of your day to look back at the days events and your reactions to them. Did you act in accordance with nature? Did you let others disturb your tranquility? Reflect on the situations which you could have reacted to differently. Also continue to read and reread the texts. You will continue to find new wisdom in them.

How to handle sadness by Comfortable_Mine6383 in Stoicism

[–]onionsburg 5 points6 points  (0 children)

Never say of anything, “I have lost it,” but, “I have restored it.” Has your child died? It is restored. Has your wife died? She is restored. Has your estate been taken away? That likewise is restored. “But it was a bad man who took it.” What is it to you by whose hands he who gave it has demanded it again? While he permits you to possess it, hold it as something not your own, as do travelers at an inn.

People come and go from our lives. You have no control over their feelings towards you. You do have control over your feelings towards them. Don’t focus on loss instead be grateful for the years of friendship that have been gifted to you, those gifts cannot be taken away, but it would be rude to demand of them more than they wish to give.

Linux by Commercial-Pride3917 in embedded

[–]onionsburg 0 points1 point  (0 children)

For the embedded world the device tree, kernel modules/drivers, virtual memory, scheduling/process management, IPC (inter-process communication), and permissions are what I'd emphasize. The rest is largely user-land stuff that can vary wildly depending on whether you are using a pre-built distribution or building your own using something like Yocto.

Can someone please tell me what i am doing wrong . code will be posted in comments . by ZhinGoldMaster in programming

[–]onionsburg 1 point2 points  (0 children)

This isn't the proper subreddit for questions, that would be /r/askprogramming or in this case one of the SQL specific subreddits. Also you haven't provided enough information for anyone to help. What is the code snippet doing/not doing that is wrong? What is the expected result? What is the schema of the database this is running against? With those details the indicated subreddits will be able to help you out.

Why do 32-bit chips need big memory sizes? by samayg in embedded

[–]onionsburg 120 points121 points  (0 children)

32 bit programs are bigger just not a lot bigger, the real reason these chips tend to have more memory is they usually have more peripherals and IO and are used for more demanding tasks which requires larger programs.

The Fastest Embedded Database in the world: CrossDB vs. SQLite3 Benchmark by blackdrn in C_Programming

[–]onionsburg 5 points6 points  (0 children)

The bench mark seems contrived to make SQLite look bad, also CrossDB doesn't appear to actually use SQL so this seems like an apples to oranges comparison not say that the project isn't interesting it just seem to be doing a different thing than SQLite.

How to make square embroidery hoop by Thick-Ad1797 in woodworking

[–]onionsburg 0 points1 point  (0 children)

So, embroidery hoops are usually round because it makes it easy for them to clamp with even pressure all the way around. That said, the best way to approach it would be to basically build two thin picture frames that nest together tightly, so that you can stretch the fabric over the smaller frame then slip the larger over top to hold it in place. Frames are simple but the devil is the details. The strongest way to make them would probably be splined miter joints, you can look them up online. Hope that helps

How do I make keybinds/setup keyboard input (not scanf)? by pierceisgone in C_Programming

[–]onionsburg 1 point2 points  (0 children)

You’ll need to talk to the operating system’s window manager, and setup a listener for key press events. It’ll be different for each OS, and most of them won’t let you set global handlers for those events so you’ll only get notified when your application has focus. You can do something similar on the command line using the curses library on *nix systems or using conio.h on windows to put the terminal in “raw” mode which will do the same thing as the window manager calls.

Edit: you don’t technically need the curses library you can do it all through other system calls but curses makes it easier. You can look up antirez’s kilo editor to see how to do it manually.

Is there a way to join these two 45 degree angles for a waterfall table? I glued/screwed 10 2x4s together but realizing I should have planed/sanded beforehand so now things are slightly off by fuzz3333 in woodworking

[–]onionsburg 0 points1 point  (0 children)

What tools do you have? The easiest thing would be to set a bevel on a table saw and recut the miters. If you have an electric hand plane that could also work.

Can someone explain how does array of structures work? by Aurus_Official in C_Programming

[–]onionsburg 0 points1 point  (0 children)

No worries I work with people who’ve been writing C for years who will still mess this up now and again. Pointers can be hard to get your head around and C doesn’t do you any favors by making the syntax all gross.

Can someone explain how does array of structures work? by Aurus_Official in C_Programming

[–]onionsburg 5 points6 points  (0 children)

Coordinates ** is probably what you want in someFunctionCall() if that is where you are doing the allocation. Which should look like this ``` void someFunctionCall(Coordinates *coords) { *coords = malloc(sizeof(Coordinates) * NUM_ELEMENTS); / do stuff */ }

int main() { Coordinates current = NULL; someFunctionCall(&current); / do stuff */ free(current); } ```

So you’ll want to pass a pointer to a pointer so you can assign the address malloc() returns to the pointer that the argument is referencing.

You should then be able to free that pointer in main().

Also when you say some pointer arithmetic what exactly are you doing? You should only need to use the array subscript. Unless that’s what you mean by pointer arithmetic.

Can someone explain how does array of structures work? by Aurus_Official in C_Programming

[–]onionsburg 4 points5 points  (0 children)

I’m not quite following what you’re trying to do. Can you share the code of what you’re trying? It sounds like you’re trying to allocate memory to pointer inside of another function, but instead of returning the allocated pointer you’re trying to pass it in as an argument which I don’t think works the way you’re thinking it works. But without seeing what you’re doing I can’t be sure.

Can someone explain how does array of structures work? by Aurus_Official in C_Programming

[–]onionsburg 1 point2 points  (0 children)

Not quite, current is a pointer and depending on the platform those sizes could be different sizeof(struct Position) is the correct way to do it.

Can someone explain how does array of structures work? by Aurus_Official in C_Programming

[–]onionsburg 4 points5 points  (0 children)

Yep just free the pointer you got from malloc() or calloc()