Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Love Stole the Day posted:

reverse a string strictly using C and not C++ with its convenient STL back_inserter.

For something like that you can pretty much just write it in 'bad c++'. Pretend you don't know about any of the c++ features, use a while loop and indexes and you've got C. (tongue in cheek but kinda sorta true)

Adbot
ADBOT LOVES YOU

Star War Sex Parrot
Oct 2, 2003

mike12345 posted:

Is "The C Programming Language"* book still the go-to reference when learning C? I did a bit of googling, and its being referenced the most. Is it didactically just that good? It's 30 years old at this point, so I'm a bit surprised there's been no other book that can rival it.

* by Brian W. Kernighan and Dennis M. Ritchie
"learning C" is a fine goal on its own and for that I'd stick to K&R, but if someone is asking me about learning C I'll typically ask "to what end?"

Driver developers, real-time embedded systems developers, database developers, etc. all use C in different ways, and while not universal within their niche, may adopt different conventions. The age of a project can also inform the conventions adopted. Approaches that are common in one domain may be completely unacceptable in another (see JPL's C coding standard). By all means use K&R as a reference guide for the language, but I'd quickly invest more time in the application-specific literature for the problem you want to tackle in C.

Star War Sex Parrot fucked around with this message at 18:12 on Nov 14, 2018

ToxicFrog
Apr 26, 2008


megalodong posted:

Are there any other things similar to /r/dailyprogrammer and the Euler project? The subreddit seems to be dead...

Ideally more on the dailyprogrammer side than the euler project i.e. not completely focused on maths.

This kind of got lost in the REST slapfight but I've had fun with Advent of Code. It's a holiday-themed thing so they only publish 25 puzzles/year, but the previous years are still available and they're a lot less math-focused than Euler.

mike12345
Jul 14, 2008

"Whether the Earth was created in 7 days, or 7 actual eras, I'm not sure we'll ever be able to answer that. It's one of the great mysteries."





Star War Sex Parrot posted:

"learning C" is a fine goal on its own and for that I'd stick to K&R, but if someone is asking me about learning C I'll typically ask "to what end?"

Hmm yeah, good point. I guess that would be robotics, I actually checked amazon and found an intro book to arduino + c, so I guess that could be my companion book.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

mike12345 posted:

Hmm yeah, good point. I guess that would be robotics, I actually checked amazon and found an intro book to arduino + c, so I guess that could be my companion book.

I've been using a Teensy 3.2 and the arduino compatibility stuff (teensyduino) with C++, no need for C. The teensy is a 32-bit microcontroller that pretends its an arduino well enough to use arduino libraries.

fritz
Jul 26, 2003

mike12345 posted:

Hmm yeah, good point. I guess that would be robotics, I actually checked amazon and found an intro book to arduino + c, so I guess that could be my companion book.

ROS is c++ https://en.wikipedia.org/wiki/Robot_Operating_System

huhu
Feb 24, 2006
Micropython on an esp8266 is also a viable option.

luchadornado
Oct 7, 2004

A boombox is not a toy!

While setting up some logging in Rust, I was looking for an easier way of passing my logger around and came across this tidbit in the slog library FAQ:

quote:

Do I have to pass Logger around?
Not necessarily. You can help yourself using slog-scope.

Note however that slog author advises not using slog_scope at all, and definitely not in libraries.

The reason is: manually passing Logger gives maximum flexibility. Using slog_scope ties the logging data structure to the stacktrace, which is not the same a logical structure of your software. Especially libraries should expose full flexibility to their users, and not use implicit logging behaviour.

Emphasis mine. After reading it a dozen times, what exactly are they trying to warn against?

Dren
Jan 5, 2001

Pillbug

Helicity posted:

While setting up some logging in Rust, I was looking for an easier way of passing my logger around and came across this tidbit in the slog library FAQ:


Emphasis mine. After reading it a dozen times, what exactly are they trying to warn against?

I am guessing but does it mean that it makes it look like all log messages came from the logger rather than from the code that originated the message?

luchadornado
Oct 7, 2004

A boombox is not a toy!

Dren posted:

I am guessing but does it mean that it makes it look like all log messages came from the logger rather than from the code that originated the message?

What you said doesn't seem wrong, but I don't see how passing a logger via constructors would prevent that vs. a global/singleton type logger instance. Especially since it would be really easy to compose a new logger on top of the globally scoped one that does the same thing, but doesn't require you passing it "down" through a bunch of constructors. If it's not clear to anyone else I'll just move along.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Often the stack trace of the current thread doesn't actually match the context you want - consider, for example, a callback that's being run after a network request completes. In that case, your callback should really be getting it's logging scope from where it was set up, and not from whatever's in charge of running network callbacks.

luchadornado
Oct 7, 2004

A boombox is not a toy!

Jabor posted:

Often the stack trace of the current thread doesn't actually match the context you want - consider, for example, a callback that's being run after a network request completes. In that case, your callback should really be getting it's logging scope from where it was set up, and not from whatever's in charge of running network callbacks.

That makes sense, and I'm getting flashbacks of troubleshooting RxJava where the stack traces in the logs are just miles and miles of "onNext" calls.

petit choux
Feb 24, 2016

Hey sorry to bother you all. I'm wanting to find a program or some kind of solution for a problem I've got and I'm not sure where to post it. Am I in the right place to ask for help in this regard?

If not, then:

Where should I take this question?

Else:

I want to use my laptop as a hotspot and share a document as I'm writing it, like with onedrive or google docs, but locally over wifi, except updating at a higher speed, like every second or two, and I want them to have read-only and no saving. So essentially they would be reading over my shoulder as I generate a doc. Prob want to give them option to copy a few lines here and there but not copy the whole doc outright.

If it could be something they could open in a web page or something like that, it would be great. Having my clients view it in something other than a word doc would be permissible too, like a messaging or chat screen, but with the above mentioned limiters, esp. being realtime update, read-only and BTW also being 100k words or more, with me appending text at 100-200 wpm for hours at end. And I'm working in Word on my end.

I've looked at a lot of free/shareware apps and nothing looks too promising. Presently wondering if putting MS Sharepoint server on my laptop would enable this but I know nothing about sharepoint really.

I'm not a programmer, but I'm not a complete idiot. Closest thing I ever do to programming is write some ahk scripts, really.

Any advice would be appreciated.

huhu
Feb 24, 2006

petit choux posted:

Hey sorry to bother you all. I'm wanting to find a program or some kind of solution for a problem I've got and I'm not sure where to post it. Am I in the right place to ask for help in this regard?

If not, then:

Where should I take this question?

Else:

I want to use my laptop as a hotspot and share a document as I'm writing it, like with onedrive or google docs, but locally over wifi, except updating at a higher speed, like every second or two, and I want them to have read-only and no saving. So essentially they would be reading over my shoulder as I generate a doc. Prob want to give them option to copy a few lines here and there but not copy the whole doc outright.

If it could be something they could open in a web page or something like that, it would be great. Having my clients view it in something other than a word doc would be permissible too, like a messaging or chat screen, but with the above mentioned limiters, esp. being realtime update, read-only and BTW also being 100k words or more, with me appending text at 100-200 wpm for hours at end. And I'm working in Word on my end.

I've looked at a lot of free/shareware apps and nothing looks too promising. Presently wondering if putting MS Sharepoint server on my laptop would enable this but I know nothing about sharepoint really.

I'm not a programmer, but I'm not a complete idiot. Closest thing I ever do to programming is write some ahk scripts, really.

Any advice would be appreciated.

Why can't you just use Google Docs? Maybe you should adjust your expectations and just use Google Docs. Unless you got money to burn in which case hire a dev and they can build it for you.

petit choux
Feb 24, 2016

huhu posted:

Why can't you just use Google Docs? Maybe you should adjust your expectations and just use Google Docs. Unless you got money to burn in which case hire a dev and they can build it for you.

Nope, not adjusting my expectations on this one that much. Among other things I need to do it where no cloud can be accessed.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

petit choux posted:

Hey sorry to bother you all. I'm wanting to find a program or some kind of solution for a problem I've got and I'm not sure where to post it. Am I in the right place to ask for help in this regard?

Would livestreaming video of you writing the doc work? I'm guessing not, since if you can't access cloud then you probably can't access Twitch/YouTube/etc. But I figured it's worth suggesting.

petit choux
Feb 24, 2016

TooMuchAbstraction posted:

Would livestreaming video of you writing the doc work? I'm guessing not, since if you can't access cloud then you probably can't access Twitch/YouTube/etc. But I figured it's worth suggesting.

I thought about it and not really, and for other reasons as well. One app I looked at that I like is RealVNC. But really it's about providing a document they can view that updates in realtime, not a screen sharing utility. I don't want them to save the doc and essentially steal my work, but I do want them to be able to navigate around in the doc on their own screen without affecting my work. ED: or search for text in it maybe, or copy a single paragraph.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
If they can view the doc, then they can copy it. At the very least their OS will provide screengrab utilities that can take images of the doc.

I don't really understand what you're trying to achieve here. I mean, I get what you've requested, I just don't understand why. Maybe there's some other way to accomplish your goal that we could suggest if we knew more about the problem?

petit choux
Feb 24, 2016

TooMuchAbstraction posted:

If they can view the doc, then they can copy it. At the very least their OS will provide screengrab utilities that can take images of the doc.

I don't really understand what you're trying to achieve here. I mean, I get what you've requested, I just don't understand why. Maybe there's some other way to accomplish your goal that we could suggest if we knew more about the problem?

Yeah, but screengrab utilities would be way too much work on their end when they can just get it through legit channels. I don't think anybody could make a way of viewing it that would be 100% secure against cheating in some fashion or another. But one thing I can do is the devices they view them from can be loaners, tablets or something, which would also limit their options on saving it. And they know they aren't supposed to usurp my work and mostly are honest. I just don't want to give them a save button or make it too easy.

I do a lot of transcription and need to share my work in realtime but locally, not cloud, and so they can basically only read the doc, not make changes or save it. High speed transcription, and for sustained periods and docs that are 100 pages or more by the end of our session.

One iffy idea was I was thinking maybe, just maybe if I purchase a MS Sharepoint server license and put it on my laptop I might be able to do something like that. But I have no experience with that and I bet there's an easier way.

And BTW, your AV is triggering me. I think I need to kill you now.

petit choux fucked around with this message at 05:28 on Nov 23, 2018

huhu
Feb 24, 2006

petit choux posted:

Nope, not adjusting my expectations on this one that much.

Calling it now, you're either going to adjust your expectations or give up.

petit choux
Feb 24, 2016

huhu posted:

Calling it now, you're either going to adjust your expectations or give up.

And I'm calling it now: what you're saying is you don't know of an answer and apparently don't believe it's possible.

(There are already programs that do this. But they come as part of huge, clunky suites that would require that I relearn everything I've already figured out. I'd just rather solve this one problem by itself.)

petit choux fucked around with this message at 05:33 on Nov 23, 2018

Volguus
Mar 3, 2009

petit choux posted:

And I'm calling it now: what you're saying is you don't know of an answer and apparently don't believe it's possible.

(There are already programs that do this. But they come as part of huge, clunky suites that would require that I relearn everything I've already figured out. I'd just rather solve this one problem by itself.)

I'm 100% sure it's possible (you mentioned that there are programs that do this), but, just like him, I am completely unaware of a tool that does what you need (actually i do not know about those programs that you mentioned either, who are they and what do they do).
So, you can either find the program that does this, hire a dev to write one for you that does only what you need (and you have control over what features it has), or adjust your expectations.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

petit choux posted:

Yeah, but screengrab utilities would be way too much work on their end when they can just get it through legit channels. I don't think anybody could make a way of viewing it that would be 100% secure against cheating in some fashion or another. But one thing I can do is the devices they view them from can be loaners, tablets or something, which would also limit their options on saving it. And they know they aren't supposed to usurp my work and mostly are honest. I just don't want to give them a save button or make it too easy.

I do a lot of transcription and need to share my work in realtime but locally, not cloud, and so they can basically only read the doc, not make changes or save it. High speed transcription, and for sustained periods and docs that are 100 pages or more by the end of our session.

OK, reading between the lines here, you're transcribing text in near-realtime, you want people to be able to read the text, but the text itself has value that you want to be able to exploit later as well. Thing is, the immediate value you're looking to provide here is the ability to read the text as it is generated. Is there some reason you can't just charge up front for the transcription service? Then you shouldn't care what they do with the transcribed text because they've already bought it.

Sorry about the avatar by the way. :v:

petit choux
Feb 24, 2016

TooMuchAbstraction posted:

OK, reading between the lines here, you're transcribing text in near-realtime, you want people to be able to read the text, but the text itself has value that you want to be able to exploit later as well. Thing is, the immediate value you're looking to provide here is the ability to read the text as it is generated. Is there some reason you can't just charge up front for the transcription service? Then you shouldn't care what they do with the transcribed text because they've already bought it.

Sorry about the avatar by the way. :v:

Can't share rough drafts! And that's a good assessment. And at least you are not a proud member of fish crew.

redleader
Aug 18, 2005

Engage according to operational parameters
VS Code Live Share can do real time, read only collaborative editing. Do you need formatting, or is plain text ok?

nielsm
Jun 1, 2009



http://etherpad.org/ maybe?

Dren
Jan 5, 2001

Pillbug
I don’t have a solution for you and haven’t heard of anything like what you’re describing. What sort of user experience are you looking for for both yu and your users? You want to write in MS Word then have your updates sent to read-only user clients in near real-time. Is MS Word a hard requirement? Do users need to be able to scroll around in the document or would it be sufficient for them to look at only the part your are writing? Does it *have* to be a live-updating document or would frequent saves to msdoc files that the users periodically refresh on their own be enough? Would a user be allowed to get the doc file? Would they be allowed to view it in word (opening in word probably means they can copy paste the whole thing but your formatting will be preserved)? I could probably keep going, the requirements aren’t very clear. If you could post the other programs that do this and list their shortcomings that might be an easier way to communicate your requirements.

petit choux
Feb 24, 2016

Dren posted:

I don’t have a solution for you and haven’t heard of anything like what you’re describing. What sort of user experience are you looking for for both yu and your users? You want to write in MS Word then have your updates sent to read-only user clients in near real-time. Is MS Word a hard requirement? Do users need to be able to scroll around in the document or would it be sufficient for them to look at only the part your are writing? Does it *have* to be a live-updating document or would frequent saves to msdoc files that the users periodically refresh on their own be enough? Would a user be allowed to get the doc file? Would they be allowed to view it in word (opening in word probably means they can copy paste the whole thing but your formatting will be preserved)? I could probably keep going, the requirements aren’t very clear. If you could post the other programs that do this and list their shortcomings that might be an easier way to communicate your requirements.

Well I wasn't sure I was even posting to the right thread so I was just trying to be brief enough you would't tl;dr me.

I'll try to be more thorough then in a bit but I think it's near sexy time RN. I'll be back in approx. 14 minutes.

Here's another question, though. Where could I find a cheap freelance developer, goons preferred, who might entertain working on this? Somebody from my own country preferred also but not absolutely required.

luchadornado
Oct 7, 2004

A boombox is not a toy!

petit choux posted:

Here's another question, though. Where could I find a cheap freelance developer, goons preferred, who might entertain working on this? Somebody from my own country preferred also but not absolutely required.

I doubt you will. I'm guessing it would take 1-2 weeks to get something 80% of the way there. Even if you only bill at $50/hr, and that 80% is fine, and there are no bugs or support needed - that's $2000-4000. This sounds like a project with no well-defined requirements, and no money behind it. As a developer, I would hard pass on this. As someone requesting this, I would figure out which requirements are most important:

- get rid of the realtime component, and just share the doc as a PDF
- get rid of the requirement that people should be able to scroll around independently if realtime is important, and expose via Google Hangouts/Slack/join.me/whatever
- get rid of the theft prevention requirement and just use Google Docs

If you can't pay the money it would really require to build this, I doubt the requirements and perceived value exist - otherwise somebody would have already made this as a standalone product.

mystes
May 31, 2006

The combination of requirements is going to make this pretty difficult unless you can find an existing site that purports to provide secure document sharing with realtime capabilities.

It's pretty trivial to update a document in real time one direction, but once you supply people's browsers with a full copy of the document it's going to be very hard to prevent them from copying it.

To get anything like that you're probably looking at rendering the text to a canvas element, obfuscating the code, etc., and it's still going to be pointless because they can screen shot it.

I guess you could try to see if you use some sort of DRM to prevent copying but that might require you to render the text to a video which isn't impossible but would be pretty wacky.

mystes fucked around with this message at 19:48 on Nov 23, 2018

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
And even then, like I said there's the analog hole. Sharing content while preventing your consumers from doing what they like with that content is more or less impossible given sufficiently determined consumer. That's why I suggested just charging them up-front for everything. Like, "$X gets you access to rough drafts as they are written as well as the completed work once it's been edited and published." Then you don't need to care what they do with the rough draft.

petit choux
Feb 24, 2016

Well, I've gotten some good good replies here and I thank all of you. I guess I should make it clear that I don't think I could ever make it 100% theft-proof no matter what and I have to rely on my clients being honorable if they want my business going forward.

The closest thing I've found to what I want in ready-made software would be these:

RealVNC -- https://www.realvnc.com/en/
MyChat -- https://nsoft-s.com/en/aboutmychat.html

And as you guys say, Google Docs or Windows OneDrive but, as I also pointed out, I will be in areas that don't have cloud access sometimes and so it wouldn't be there for me then. Both of the above programs above claim to work locally and I've verified RealVNC definitely does. And as for mychat I could probably use AHK to make a workaround to get it to cut and paste new text to the chat window. But I know nothing about these guys.

Maybe I can just tell my client to use the RealVNC viewer app and use screenshots instead of cutting and pasting text. It works locally, appears fairly easy and doesn't crash anything, and would help prohibit work product theft.

User uhuh, you are probably right. Right now shelling out 5k or more for this is too much, I am not too rich and if I had that I'd probably buy a second laptop so as the economy crashes I won't have to worry about buying another for a while. I was just hoping that it would be an easier or cheaper proposition in general, I guess. The all-in-one software suite that includes this feature is a few grand and I'm paying for it by monthly installments and haven't properly learned to use it yet, as it involves relearning all my keyboard shortcuts, building up a new user profile, etc. And I've noticed that among other things, since I've installed this suite 2 weeks ago I've had about 3-5 unaccountable BSODs, as well, which may or may not be attributable to them.

Anybody wanting to make any proposals, suggestions or whatever, feel free to PM me. Don't put too much effort into it without talking to me though.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

I was curious in the abstract about it and looked around, but where-ever I found it was part of big expensive document collaboration suites (e.g. sharepoint, xmind, huddle, et al), so you're probably right in that OP.

JawnV6
Jul 4, 2004

So hot ...
God just save a text file every line or two, shove a dumb http server up on your laptop, write 3 lines of HTML to auto refresh.

Folks who can’t imagine sharing plain loving text between two computers without full internet access and Googles cloud backend are embarrassing. Y’all consider yourselves professionals?

spiritual bypass
Feb 19, 2008

Grimey Drawer
the answer is a shared server with tmux

luchadornado
Oct 7, 2004

A boombox is not a toy!

JawnV6 posted:

God just save a text file every line or two, shove a dumb http server up on your laptop, write 3 lines of HTML to auto refresh.

Folks who can’t imagine sharing plain loving text between two computers without full internet access and Googles cloud backend are embarrassing. Y’all consider yourselves professionals?

This isn't a programming question - this is someone looking for a product to cover a niche case for their work. I'm guessing there are more hard requirements present than a day's worth of work would cover.

For funsies though:
1. use an editor and configure it to auto save every minute
2. have a really simple node.js or python server read the file and serve it up
3. have a simple html page that polls your server and returns all of the current text - obfuscate it to make it a little more annoying to copy or hit the API directly
4. have script on your html page render the content into a canvas
5. add some slippy type scrolling so they can scroll through the document within the canvas

You could do that in a day, I suppose. And while it isn't secure, unless you were a developer it would be pretty difficult to get around.

Dren
Jan 5, 2001

Pillbug

JawnV6 posted:

God just save a text file every line or two, shove a dumb http server up on your laptop, write 3 lines of HTML to auto refresh.

Folks who can’t imagine sharing plain loving text between two computers without full internet access and Googles cloud backend are embarrassing. Y’all consider yourselves professionals?

Lol. His requirements are poorly defined, basic questions havent been answered. We have no idea if plaintext would suit his needs or not. If it would then yeah, easy answer.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

petit choux posted:

Well I wasn't sure I was even posting to the right thread so I was just trying to be brief enough you would't tl;dr me.

I’ll try to be more thorough then in a bit but I think it’s near sexy time RN. I’ll be back in approx. 14 minutes.

Here's another question, though. Where could I find a cheap freelance developer, goons preferred, who might entertain working on this? Somebody from my own country preferred also but not absolutely required.

Your gimmick of refusing to engage with people trying to clarify requirements is whatever but please refrain from being a gross creep on top of it

JawnV6
Jul 4, 2004

So hot ...

Dren posted:

Lol. His requirements are poorly defined, basic questions havent been answered.
I'm guessing you work somewhere with a translator or two between you and a customer?

Dren posted:

We have no idea if plaintext would suit his needs or not. If it would then yeah, easy answer.
If "AHK copying into MyChat" is acceptable, I think we have an idea on the needs-suitingness of plaintext. Like christ, read between the lines just a little. Or we could continue to approach the problem from "Google Docs without the cloud is the only acceptable solution, let's code it up from scratch before gathering any more requirements" despite the fact that's it's asinine and doomed from the start. Are they not telling stories about "ship an MVP and refine from there" any more?

Helicity posted:

really simple node.js or python server
but
why

Adbot
ADBOT LOVES YOU

luchadornado
Oct 7, 2004

A boombox is not a toy!


Why not? You're suggesting this is a trivial solution, so why bother with build scripts, compilation, vms, etc when you can use Express or Bottle and do it in 20 lines of code written by any level developer?

Hypothetically write it in whatever language is easiest/fastest for you, I don't care. If you're a polyglot it will probably be node/python.

luchadornado fucked around with this message at 01:53 on Nov 24, 2018

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply