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
csammis
Aug 26, 2003

Mental Institution
What was that "something" you dragged it into?

The file system on OS X is a hierarchical collection of folders, just like Windows or Ubuntu that you're used to. OS X is pretty much a BSD under the hood for most practical purposes. A freshly-installed Finder doesn't make it super easy to get to / but you should have no issue with Terminal if you're used to using a command line in Ubuntu.

quote:

nothing seems to have an actual directory associated with it

It's really not much different from how Explorer elides some of the details of the filesystem from you. If you drag something to the desktop on Windows, it ends up in C:\Users\<yourname>\Desktop. On OS X it ends up in /Users/<yourname>/Desktop.

As for your IDE, I haven't used Netbeans before but once you know what directory you put the Textmarks files into then you should have some option to add files to your project from a directory. This looks likely.

Adbot
ADBOT LOVES YOU

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

Peristalsis posted:

I'm trying to write a small java application using this third party library. The difficulties are that I haven't used java in a while, I haven't used Macs for development before, and I haven't used NetBeans before.

Right now, I just want to know how to import this library into my project to use in my code. Being a PC guy, I downloaded the library zip file, extracted its contents, and tried to move the extracted directory into a directory or place or something* that looked like it had other java stuff in it. However, I don't see any way to access or link to it from my project in NetBeans.

You need to right-click on your project, go to Properties, take the Libraries tab, and then add the library jar to your project.


quote:

* I still haven't really figured out the directory and file structure on OS X. Finder doesn't seem like much of an analog to Windows Explorer, or even the explorer-like thing on Ubuntu, and nothing seems to have an actual directory associated with it, so doing things directly from a command prompt seems sketchy.

OSX is POSIX-compliant, it just doesn't want to admit it, so you have to try really hard to get it to admit that things like "directory paths" even exist. You can open up Terminal (which is in /Applications/Utilities), and then drag a file/folder into it to get the path of that file/folder, though.

raminasi
Jan 25, 2005

a last drink with no ice
Also in a Finder window Cmd-Shift-G will open a "go to wherever" dialog box, I've found it super useful. (It understands ~, which is really helpful.)

Peristalsis
Apr 5, 2004
Move along.

csammis posted:

What was that "something" you dragged it into?

I clicked on Finder then selected "All My Files" in left pane. In right pane, files are shown grouped by type (images, documente, etc.) One "type" is "Development", and it has a bunch of java files in it, presumably from NetBeans examples or the like. I dragged the extracted folder to that group. Annoyingly, I didn't verify if it shows up in the group now, because I immediately started trying to import it into NetBeans. (It was late, I was tired, IT WASN'T MY FAULT, etc.)

csammis posted:

The file system on OS X is a hierarchical collection of folders, just like Windows or Ubuntu that you're used to. OS X is pretty much a BSD under the hood for most practical purposes. A freshly-installed Finder doesn't make it super easy to get to / but you should have no issue with Terminal if you're used to using a command line in Ubuntu.

It's really not much different from how Explorer elides some of the details of the filesystem from you. If you drag something to the desktop on Windows, it ends up in C:\Users\<yourname>\Desktop. On OS X it ends up in /Users/<yourname>/Desktop.

As for your IDE, I haven't used Netbeans before but once you know what directory you put the Textmarks files into then you should have some option to add files to your project from a directory. This looks likely.

TooMuchAbstraction posted:

You need to right-click on your project, go to Properties, take the Libraries tab, and then add the library jar to your project.

OSX is POSIX-compliant, it just doesn't want to admit it, so you have to try really hard to get it to admit that things like "directory paths" even exist. You can open up Terminal (which is in /Applications/Utilities), and then drag a file/folder into it to get the path of that file/folder, though.

raminasi posted:

Also in a Finder window Cmd-Shift-G will open a "go to wherever" dialog box, I've found it super useful. (It understands ~, which is really helpful.)

Thanks for the replies, I'll give it another shot some evening or this weekend. I guess in the worst case, I can just use a text editor and do everything from the command line, but this seemed like a nice project to learn a bit more about the Mac and a new IDE. I used Eclipse at my last job, but thought it'd be nice to try out something different.


As for hidden POSIX compliance, I guess I'm also curious how regular users are intended to interact with OS X. Does everything just go to some default directory, and then the OS makes its best guess about how to group different files? How are users supposed to store Word documents, text files, photos, etc., if they can't see and organize directories? I don't mean that in a plaintive way, I just don't quite get the approach at this point. I've read over an article or two with titles like "OS X for Windows Users", but they (quite rightly) seemed to hit highlights just for getting started, without delving into best practices for storing lots of files or structuring sub-directories.

ArcticZombie
Sep 15, 2010
The problem is you are using "All My Files". Don't use that. it's rear end. There is a regular directory structure just like you're used to. "All My Files" hides that though.

VV I actually forgot that by default All My Files is all you get. Dumb. Go to Finder > Preferences and go to the sidebar tab. Tick/Untick all the things. VV

ArcticZombie fucked around with this message at 16:05 on Sep 8, 2016

Peristalsis
Apr 5, 2004
Move along.

ArcticZombie posted:

The problem is you are using "All My Files". Don't use that. it's rear end. There is a regular directory structure just like you're used to. "All My Files" hides that though.

Okay, but where do I see/access this regular directory structure? Finder has a desktop option, so I get to any subdirectories of that, and an "Application" option, which is presumably like Windows' Program Files directory, but there's no "computer" or "main hard drive" option (at least on the MacBook I have access to at work). Is CLI the only way to go for this?

csammis
Aug 26, 2003

Mental Institution
Hah, I forgot about All My Files...that poo poo has got to go if you're going to be using OS X for any amount of time.

Open a Finder window, go to the Finder menu at the top and click Preferences. Under General select something other than "All My Files" for "New Finder windows show:" - I use the username folder. Under Sidebar uncheck "All My Files" and add anything you think might be useful. It will trouble you no more.

lord funk
Feb 16, 2004

God I hate 'All My Files.' My mother-in-law cannot understand that seeing two of the same file doesn't mean there are duplicates. So she sees them in All My Files and is like "Why is there another copy? Better delete it."

Also it should be renamed "A Random Assortment of Some of My Files."

Peristalsis
Apr 5, 2004
Move along.

csammis posted:

Hah, I forgot about All My Files...that poo poo has got to go if you're going to be using OS X for any amount of time.

Open a Finder window, go to the Finder menu at the top and click Preferences. Under General select something other than "All My Files" for "New Finder windows show:" - I use the username folder. Under Sidebar uncheck "All My Files" and add anything you think might be useful. It will trouble you no more.

Okay, now we're cooking. I think that was my missing piece - now I have easy GUI access to my home directory and the hard drive (I think). I still need to clarify exactly what I'm seeing in the UI vs at a terminal window, but at least I have a place to start now. Thanks!

Edit: Also, I didn't exactly choose to use All My Files, that's just what was selected when I opened the Finder window, and I didn't see anything more useful among the other default options.

Peristalsis fucked around with this message at 16:12 on Sep 8, 2016

csammis
Aug 26, 2003

Mental Institution
Glad you're on your way! The hard drive is called "Macintosh HD" by default, that's what you'd be looking for. That said it's Good Practice to keep all your poo poo, including building projects, under your home directory. I've found that I rarely have a reason to navigate to the root in Finder.

quote:

I didn't exactly choose to use All My Files

We've all been hurt by All My Files at one point, friend :unsmith:

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'
The finder doesn't show the standard UNIX directories located on the root of the drive, but other than that wysiwyg, there's nothing to figure out. The Library(ies?) directory (in home and root) is likely of interest as that's the standard location for installing frameworks and the like, although you're free to put your stuff wherever you want.

return0
Apr 11, 2007
You can also just use a terminal to navigate around. If you want to open a directory in Finder then do 'open .'

Harriet Carker
Jun 2, 2009

Ignore me, solved my problem!

Harriet Carker fucked around with this message at 04:24 on Sep 9, 2016

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I have a project that I'm using make to build and it has say three targets: program1, program2, program3. I'm trying to do the following with make:

In my makefile:
code:
FFLAGS = -O0
FDEBUG = -warn all
FOPTIM = -O3

...

all: program1 program2 program3

program1:
    $(FC) $(FFLAGS) ...
When I do:
code:
$ make all
Makes program1, program2, program3. This is fine.

But I also want to be able to do something like:
code:
$ make debug program2 program3
The 'debug' flag should do something like
code:
FFLAGS += $(FOPTIM)
And then it should build program2 and program3 normally. Similarly 'make release program3' should do 'FFLAGS += $(FOPTIM)' and so on.

Right now I can do something like this:
code:
all: program1 program2 program3

debug: FFLAGS += $(FDEBUG)
debug: all
And it works in the sense that it will build 'all' with FFLAGS+FDEBUG but I want to be able to build individual targets. Basically I want debug and release to be treated like optional --options.

Can anyone help me out?

If it helps I will never need to do anything silly like: make debug program2 release program1 so it doesn't need to be too complicated.

Boris Galerkin fucked around with this message at 17:13 on Sep 9, 2016

JawnV6
Jul 4, 2004

So hot ...
Can you just pass RELEASE as an environment variable (make RELEASE=1 program1, or export it before invocation) then switch what you're doing based on that with ifeq?

nielsm
Jun 1, 2009



Yeah don't try to abuse targets to modify the meaning of other targets. Just pass extra variables as JawnV6 suggests.

Kilson
Jan 16, 2003

I EAT LITTLE CHILDREN FOR BREAKFAST !!11!!1!!!!111!
In a bash script, I'm trying to compare two flattened directory trees and determine which files exist in tree1 and not in tree2. So I have this:
code:
comm -23 <(find tree1 -type f -printf '%f\n' | sort) <(find tree2 -type f -printf '%f\n' | sort)
This works. It prints out the correct list of files.

But here:
code:
comm -23 <(find tree1 -type f -printf '%f\n' | sort) <(find tree2 -type f -printf '%f\n' | sort) > /some/file.txt
then /some/file.txt is created, but it's blank. If I type the same command on the command line, the output file is created with the proper contents. I don't see any reason this shouldn't work from within a script - is there?

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

JawnV6 posted:

Can you just pass RELEASE as an environment variable (make RELEASE=1 program1, or export it before invocation) then switch what you're doing based on that with ifeq?

nielsm posted:

Yeah don't try to abuse targets to modify the meaning of other targets. Just pass extra variables as JawnV6 suggests.

That worked, thanks.

Also spent a considerable amount of time now reading the manual and trying to understand examples and such. Now the implicit rules and things make more sense and I was able to simplify my makefile by a lot.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
This isn't a programming question really, more of a web configuration one. I have my own webhosting that I use for this and that, and one of the things I use it for is to host images that I can then include in posts I make on these forums.

Recently that stopped working. The browser shows a "broken link" icon when I try to include the image; even though if I change it from an "img" tag to a "url" tag, I can then click on the link and it will load the image without any problems.

I looked in Chrome's developer console and it shows an error: "Failed to load resource: net::ERR_INSECURE_RESPONSE". The URL alongside this error is the correct URL I entered in my post, except that "http" has been changed to "https".

Example image:



http://junk.orderofthehammer.com/j2016/fish2.jpg

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

Hammerite posted:

I looked in Chrome's developer console and it shows an error: "Failed to load resource: net::ERR_INSECURE_RESPONSE". The URL alongside this error is the correct URL I entered in my post, except that "http" has been changed to "https".

Example image:



http://junk.orderofthehammer.com/j2016/fish2.jpg

Your image loaded fine for me. I think your browser is insisting on only loading things over https, so it auto-converts http to https and then complains when your server doesn't support that. You could try enabling https, but you might also need to get a certificate for your site (edit: assuming Chrome doesn't like your self-signed cert, which it probably won't unless you add a manual exemption in your browser -- which other people won't have of course), which costs money.

TooMuchAbstraction fucked around with this message at 14:51 on Sep 11, 2016

nielsm
Jun 1, 2009



TooMuchAbstraction posted:

Your image loaded fine for me. I think your browser is insisting on only loading things over https, so it auto-converts http to https and then complains when your server doesn't support that. You could try enabling https, but you might also need to get a certificate for your site (edit: assuming Chrome doesn't like your self-signed cert, which it probably won't unless you add a manual exemption in your browser -- which other people won't have of course), which costs money.

https://letsencrypt.org/

MrMoo
Sep 14, 2000

TooMuchAbstraction posted:

Your image loaded fine for me. I think your browser is insisting on only loading things over https, so it auto-converts http to https and then complains when your server doesn't support that. You could try enabling https, but you might also need to get a certificate for your site (edit: assuming Chrome doesn't like your self-signed cert, which it probably won't unless you add a manual exemption in your browser -- which other people won't have of course), which costs money.

This happens with HSTS, somewhere your browser must have seen a HSTS header on your domain.

pseudorandom name
May 6, 2007

MrMoo posted:

This happens with HSTS, somewhere your browser must have seen a HSTS header on your domain.

Something Awful supplies a Content-Security-Policy: Upgrade-Insecure-Requests header in all HTTP responses.

Total Meatlove
Jan 28, 2007

:japan:
Rangers died, shoujo Hitler cried ;_;
Is there a way, using adobe acrobat xi, to create a form, and then use the information provided to determine which pages print from it?

I have a file with 15 different types of schedules that have to be printed and attached to a job pack, but each job requires a different type and variety of schedules. Essentially I'd love to have;

1) Form Page
2) S. 1
3) S. 2
4) S. 3
5) S. 4
6) S. 5

> user fills out form, only S.1 required. Presses print button, Adobe lines up page 1-2 to print.
> user fills out form, S.2 & S.4 required, Presses print button, Adobe lines up pages 1,3,5 to print

If possible, without using JavaScript either.

My initial thought was to have a hidden field that triggered if a page was selected saying 'print me' and then having that picked up by the button push on mouse up but I can't find anything in googling that would pick that up.

Linear Zoetrope
Nov 28, 2011

A hero must cook
I was looking over one of my old wrappers, and I'm wondering how you all would handle something. The library I'm wrapping only has one way to load or save a type: calling a function with a string pointing to a file destination. However, I want my type to be serializable using the language's serialization feature.

I accomplished this by:

1. Giving the library a path to a temporary file (the name is generated with a temp file library, but could use any method for making a quick temp file)
2. Loading the file from my wrapper as a glob of bytes
3. Serializing that (and any other metadata I need) with the provided encoder
4. Deleting the temp file

Loading is then basically doing this in reverse, writing the glob of bytes to a temp file, giving that path to the library, and deleting the temp file.

This works, and is probably the "obvious" workaround, but I don't know if there's a better way to do it.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Jsor posted:

I was looking over one of my old wrappers, and I'm wondering how you all would handle something. The library I'm wrapping only has one way to load or save a type: calling a function with a string pointing to a file destination. However, I want my type to be serializable using the language's serialization feature.

I accomplished this by:

1. Giving the library a path to a temporary file (the name is generated with a temp file library, but could use any method for making a quick temp file)
2. Loading the file from my wrapper as a glob of bytes
3. Serializing that (and any other metadata I need) with the provided encoder
4. Deleting the temp file

Loading is then basically doing this in reverse, writing the glob of bytes to a temp file, giving that path to the library, and deleting the temp file.

This works, and is probably the "obvious" workaround, but I don't know if there's a better way to do it.

You almost certainly don't need to write a file, the ease of doing so depends on the language you're using and if you have source access to the underlying type.

What you have is a straightforward workaround for a seemingly bad API. It sounds like the simplest alternative is a memcpy, but I can't know that there aren't hidden types allocated that you would probably need to replicate as well.

e:
You may want to look into how your language handles reflection.

leper khan fucked around with this message at 12:52 on Sep 13, 2016

Linear Zoetrope
Nov 28, 2011

A hero must cook

leper khan posted:

You almost certainly don't need to write a file, the ease of doing so depends on the language you're using and if you have source access to the underlying type.

What you have is a straightforward workaround for a seemingly bad API. It sounds like the simplest alternative is a memcpy, but I can't know that there aren't hidden types allocated that you would probably need to replicate as well.

Yeah, the problem is that while I have access to the exposed types, the thing is a snake's nest of pointers to structs to pointers (some of which may be null, or irrelevant). Deep copies of the underlying objects are non-trivial.

E to your E: It's an FFI wrapper, reflection won't help me. I'm wrapping a C Library in Rust (which only barely has reflection anyway).

Linear Zoetrope fucked around with this message at 12:54 on Sep 13, 2016

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Jsor posted:

Yeah, the problem is that while I have access to the exposed types, the thing is a snake's nest of pointers to structs to pointers (some of which may be null, or irrelevant). Deep copies of the underlying objects are non-trivial.

If you have write access to the exposed types, you could easily add deep copy functions to every viper in the pit.

If there weren't a really strong need for it, I'd probably just :effort:

ExcessBLarg!
Sep 1, 2001

Jsor posted:

This works, and is probably the "obvious" workaround, but I don't know if there's a better way to do it.
On Unix/Linux you can used a named pipe (FIFO). Like the "create a file" workaround it requires writing an inode somewhere to the file system with it's associated permission and cleanup issues, but you'll be writing to a pipe at least and not having to write the whole file.

On Linux (and elsewhere?) you can use an anonymous pipe (pipe(2)) and pass the path "/dev/fd/(read or write fd)" to the library. This has the advantage of not needing to write an inode, so there's no permission or cleanup issues, but it requires having /dev/fd support.

In either case you'll have to be careful about doing I/O to the pipe in sync with the library. On modern Linux the default pipe capacity is 64 kB, so if your files are always smaller than that, you usually can get away with writing the whole file to the pipe at once, then reading it at once. But you should expect that reads/writes to the pipe will block, so may need to fork or use a thread to call the library function with one side of the pipe while "simultaneously" serializing it on the other side.

omeg
Sep 3, 2012

Okay, what the actual gently caress. Why there is still no debug/checked Windows 10 iso on MSDN? I have MSDN pro access and the only thing I see is debug symbols, not the actual image. Am I just blind?

General_Failure
Apr 17, 2005
I've had a brain fart. How do I assign a value as the address of a pointer without a compiler warning?
On my phone so I can't give exact but close enough. It's code to get the base address of mapped IO on a Raspberry pi. Trouble is I'm grabbing the address from a register. What I'm doing works but the compiler bitches.
code:
 
p_GPIO = reg.r[3];

p_GPIO is a pointer obviously.

e: and now I see the C/C++ thread.

General_Failure fucked around with this message at 07:06 on Sep 14, 2016

sarehu
Apr 20, 2007

(call/cc call/cc)

General_Failure posted:

I've had a brain fart. How do I assign a value as the address of a pointer without a compiler warning?

What value do you want to give the address of what pointer to?

General_Failure
Apr 17, 2005

sarehu posted:

What value do you want to give the address of what pointer to?

...uh.

alright here's the relevant lines slapped together more or less. Not all are from the same place. it doesn't really matter. Ignore typos because I'm transcribing from the other computer.

code:
volatile unsigned long *p_GPIO; //this is to point to the base address of the GPIO registers.

_kernel_swi_regs reg; //this is a structure that can be accessed as reg.r[n] but is passed differently like the following
_kernel_swi(OS_Memory, &reg, &reg); //The regs have values not typed here.
p_GPIO = reg.r[3]; //This gives me the warning.

As seen, the last line throws the warning with good reason. It's valid but not pretty. The contents of r[3] is the virtual address of the IO mapped to memory. To be useful I have to shove that into a pointer, which I do. I feel like I should be casting it somehow though to get rid of the warning. The resultant address of the pointer is correct still.

While I'm here. Did I do this right? It's meant to clear bits 3,4,5 of tmpReg. I can't test it right now.
tmpReg is an unsigned long.
code:
tmpReg &= (~(0b111<<3));

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

General_Failure posted:

While I'm here. Did I do this right? It's meant to clear bits 3,4,5 of tmpReg. I can't test it right now.
tmpReg is an unsigned long.
code:
tmpReg &= (~(0b111<<3));

If there's confusion about what your code is doing, you did it wrong even it functions correctly.

Try something more like:

code:
const int ins_src_flag_mask  = 0b00000111;
const int ins_dest_flag_mask = 0b00111000

// later...

tmpReg &= ~ins_dest_flag_mask
(Obviously, give things names appropriate to their actual use, instead of what I made up for demonstration purposes.)

ToxicFrog
Apr 26, 2008


General_Failure posted:

As seen, the last line throws the warning with good reason. It's valid but not pretty. The contents of r[3] is the virtual address of the IO mapped to memory. To be useful I have to shove that into a pointer, which I do. I feel like I should be casting it somehow though to get rid of the warning. The resultant address of the pointer is correct still.

You still haven't said what the warning is, but at a guess it's something like "assignment makes pointer from integer without a cast"? The warning itself tells you what the solution is: explicitly cast the rvalue to the correct pointer type to indicate to the compiler that you're doing this unsafe thing deliberately.

General_Failure
Apr 17, 2005

ToxicFrog posted:

You still haven't said what the warning is, but at a guess it's something like "assignment makes pointer from integer without a cast"? The warning itself tells you what the solution is: explicitly cast the rvalue to the correct pointer type to indicate to the compiler that you're doing this unsafe thing deliberately.

Yes sorry. That's the warning. Sorry I don't know where my head has been at. It does add "[ enabled by default ]" to the end. But yes. Casting it worked fine by the way. I tried it previously before making some other changes and it kind of blew up on me. I think it was before I changed the pointer type. I'm trying to access the GPIO registers on a Raspberry Pi 3 in RISC OS using GCC. It's a bit of a minefield. A lot of things that should work just don't for various reasons. There are still issues with my admittedly simple code but it compiles, doesn't do a stack dump or segfault now. It still doesn't achieve it's simple "Hello World" goal of turning on an LED attached to GPIO21 but it's getting there. I only learned last night that I haven't quite initialised the IO pins correctly, but I'm getting there.


Jabor posted:

If there's confusion about what your code is doing, you did it wrong even it functions correctly.

Try something more like:

code:
const int ins_src_flag_mask  = 0b00000111;
const int ins_dest_flag_mask = 0b00111000

// later...

tmpReg &= ~ins_dest_flag_mask
(Obviously, give things names appropriate to their actual use, instead of what I made up for demonstration purposes.)

Thanks for that. I managed to steal a minute to test it just now. With that line of code it was kind of the opposite. It seemed clear to me what it should do but C has a habit of disagreeing with me. It worked as expected.

ufarn
May 30, 2009
I've apparently got the Homebrew version of Keybase installed, but I want to use the dedicated installer instead. How do I go about deleting/delinknig my Homebrew installation without removing my files and configs?

csammis
Aug 26, 2003

Mental Institution
Back up your files and configs somewhere and run brew uninstall keybase

SurgicalOntologist
Jun 17, 2004

What's the proper way to stream JSON items in a commandline interface to support piping? It seems one can either make the entire thing JSON-compliant, or make each line JSON-compliant, but not both.

That is, I'm trying to decide if my program should output

code:
[
    ...item...,
    ...item...,
    ...item...,
]
or just
code:
...item...
...item...
...item...
where ..item... is some valid JSON.

To make things harder to decide, the program will sometimes be used to pass short lists of items, and sometimes to stream items more or less indefinitely.

Adbot
ADBOT LOVES YOU

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 you're talking about piping, then ideally whatever you're piping JSON into should be able to consume and operate on data as it arrives, instead of needing to wait for the entire dataset to become available. So you should design your output so that the consumer doesn't need to wait for e.g. a final "}" or "]" before they can start processing. Maybe have some declared delimiter between JSON records (a newline, perhaps) to make it easy for the consumer to know how much text to consume in one go.

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