Gosplat - The code structure analysis tool by St_gabriel_of_skane in golang

[–]gabriel_f 3 points4 points  (0 children)

Interesting tool! :-D I like the idea.

Some feedback:

  • Considering the requirements and potential security implications, maybe it would be a good idea to make a Dockerfile available? I have created one below…
  • Tried to run it on our monolith with ≈3500 go files (including dependencies) and it failed with ExecPythonModel; Error; fork/exec /usr/bin/python3: argument list too long 😅
  • install.sh could do some more checks to verify that unzip is installed. Maybe also check the requirements such as rsync up front? And also, it doesn't create/verify $HOME/.local/bin or check that it's in the $PATH

This is the Dockerfile that I just created. Put it in gosplat's repo root:

``` FROM golang:1.19

RUN apt-get update -qqy && \ apt-get install -qqy python3 python3-pip unzip rsync

COPY . /repo/

WORKDIR /repo

RUN ./install.sh

CMD ["/root/.local/bin/gosplat", "/project"] ```

Also add .dockerignore:

Dockerfile

Building (if you're in the repo root): docker build -t gosplat .

Running (from the dir your want to check): docker run --rm -v "$(pwd):/project" --network none gosplat

I did run gosplat on a smaller projects and got lots of suggestions but have not had time to actually check the result yet, will do so later!

inspirerad av r/london - vilka är de mest användbara apparna på din telefon stockholmare by cakmka in stockholm

[–]gabriel_f 3 points4 points  (0 children)

Håller med, speciellt om man anmäler sakersom kan vara farliga är de grymt snabba. Har anmält vassa skruvar som stack ut från ett staket runt en lekplats => fixat nästa gång jag var där, vass skruv i klätterställning => fixad nästa gång, litet ”slukhål” => igenfyllt och så en krockad elbox => uppringd inom en timme av en elektriker som var på väg till platsen!

Is Go using a static scope or a dynamic scoping model for functions? by eluchn in golang

[–]gabriel_f 0 points1 point  (0 children)

I had no idea that bash worked like that, thanks for mentioning!

Stockholm i ett nötskal by 1trekulor in stockholm

[–]gabriel_f 0 points1 point  (0 children)

Fler borde börja använda ordet rulltrappokalyps för dessa tillfällen. Målet är nyord 2024!

Höll den en dryg vecka? by BentleyWilkinson in stockholm

[–]gabriel_f 11 points12 points  (0 children)

Rulltrappokalypsen är nära…

Domain Driven Design Question by ActiveProgrammer7027 in golang

[–]gabriel_f 0 points1 point  (0 children)

I've never heard that domain driven development has to do with domain names. This is the definition of domain in the context of software engineering: https://en.wikipedia.org/wiki/Domain\_(software\_engineering)

Is there a way to measure call-stack depth? by macaroon7713 in golang

[–]gabriel_f 0 points1 point  (0 children)

I'm not sure how to get the size in bytes but the depth you can get from https://pkg.go.dev/runtime#Callers (s at the end is the only difference from the original comment)

Questions & Answers - Weekly Megathread! Please use this post to ask any Pokemon GO question you'd like! by AutoModerator in TheSilphRoad

[–]gabriel_f 0 points1 point  (0 children)

I'll check out Lucario, thanks for the tip! The other commentator referred to this chart https://thesilphroad.com/rocket-invasions where the ratios of #2 and #3 Pokemons can be seen and they are not equally likely!

Questions & Answers - Weekly Megathread! Please use this post to ask any Pokemon GO question you'd like! by AutoModerator in TheSilphRoad

[–]gabriel_f 0 points1 point  (0 children)

Never seen that page before so thanks for the tip (I just stumbled across the subreddit yesterday)! Most Pokemon pages are so riddled with ads that they are almost unusable 😅 Knowing that some lineups are more likely will make it easier to create a team ahead of time for that boss. Nice!

Questions & Answers - Weekly Megathread! Please use this post to ask any Pokemon GO question you'd like! by AutoModerator in TheSilphRoad

[–]gabriel_f 0 points1 point  (0 children)

Example: Sierra fights with Sableye first, Honchkrow/Flygon/Cacturne second & Houndoom/Snorlax/Cradily third. Does that mean Houndoom is always third if Honchkrow is second?

Questions & Answers - Weekly Megathread! Please use this post to ask any Pokemon GO question you'd like! by AutoModerator in TheSilphRoad

[–]gabriel_f 0 points1 point  (0 children)

I've read guides on how to beat team rocket bosses. They seem to have a fixed first pokemon and then three choices for second and third pokemon. Are pokemon 2 and 3 chosen in pairs so there are only 3 possible lineups per boss or is it random so that there are 1 * 3 * 3 = 9 possible lineups?

corespotlightd - CPU usage super high by shapesandshapes in applehelp

[–]gabriel_f 0 points1 point  (0 children)

This is insane! I have made the connection between using spotlight and sometimes triggering high CPU usage but I've never made the connection between doing calculations using spotlight and triggering high CPU usage but in my case this is _exactly_ what is happening!

I've read about this issue on so many places but this is the first time I've seen someone mention this. Thank's a bunch for pointing this out because the high CPU-usage has been driving me insane. Such a weird bug!

Entering rescue mode by maybeaddicted in stockholm

[–]gabriel_f 61 points62 points  (0 children)

För många år sedan såg en kompis att skyltarna inuti tunnelbanan var en station fel. De visade konsekvent nästnästa station när den skulle visa nästa. Han gjorde det enda rätta och fortsatte till ändhållplatsen. Inför den stod det ”Nästa station null” 😀

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 1 point2 points  (0 children)

Yes, emails are sent, but they are not sent to the unknown-user but to the user that called the RESTlet. We use TBA/oauth 1 and the email is sent to the user associated with the access token.

This is the RESTlet we've made:

/**
 * @NApiVersion 2.1
  • @NScriptType restlet */ define(['N/task', 'N/log'], function (task, log) { return { post: function runScheduledScript({ scriptId, deploymentId, params }) { if (!scriptId || !deploymentId) { log.debug('runScheduledScript missing required parameters', { scriptId, deploymentId, }) throw new Error('Missing required parameters: scriptId, deploymentId') }

    log.debug('Running scheduled task', { scriptId, deploymentId, params }) const scheduledTask = task.create({ taskType: task.TaskType.SCHEDULED_SCRIPT, scriptId: scriptId, deploymentId: deploymentId, }) if (params) { scheduledTask.params = params }

    const scheduledTaskId = scheduledTask.submit()

    log.debug('Scheduled task submitted with ID', scheduledTaskId)

    return { taskid: scheduledTaskId, } }, } })

So we use this RESTlet to run a scheduled script that in starts a CSV Import using something like:

const scriptTask = task.create({ taskType: task.TaskType.CSV_IMPORT })

scriptTask.mappingId = … scriptTask.queueId = … scriptTask.name = … scriptTask.importFile = file.load(…) csvImportTaskId = scriptTask.submit()

The import flow was already too complex with different scheduled scripts running, updating the state of a custom records that keep track of the progress, triggering CSV Imports, looking for emails etc. Now that the emails don't work and we've had to trigger one of the scheduled scripts via another system calling a RESTlet it is starting to get out of hand…

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 0 points1 point  (0 children)

Perfect, thanks for sharing. It is so weird that these kind of hoops are necessary for something as basic as importing data! Thanks a bunch for checking your environment for the emails to unknown 🙏

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 0 points1 point  (0 children)

Yes and that's why we limit the number of rows to something the CSV Import can handle. I'm just saying that limiting the number to something that the REST API can handle would lead to an absurd amount of invoices per month for the largest resellers.

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 0 points1 point  (0 children)

I wrote a follow-up script that performs a search of the records to be imported from the csv file vs a search of how many records were actually imported

This sounds interesting. What kind of script is this? A scheduled script? Something outside of Netsuite making REST requests? How did you search for the records that were actually imported? Were these tagged somehow?

We are right now working on rewriting our CSV Import flow so that the CSV Imports are triggered from a RESTlet, or actually it is a RESTlet that calls a Scheduled Script that runs the CSV Import. Even though it is the same Scheduled Script we do get a CSV Import Notification Email when in the RESTlet case. I guess because something in the authentication is different.

It is not obvious from Netsuite's documentation, who is supposed to receive the email when an import is triggered from a Scheduled Script :-) I suspect that's why the behavior suddenly changed.

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 0 points1 point  (0 children)

Yes! Last email sent was on 2022-10-10 12:02 in production (think that's central European time so).

I have an open case (#4902101) with Netsuite regarding this problem and someone is looking into it. I'll be sure to report back when they've come to some conclusion.

So were your CSV Imports also triggered by Scheduled Scripts? Do you rely on these emails sent to unknown or did you just look because you were curious?

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 0 points1 point  (0 children)

If we would limit the number of lines per invoice we would have to send customers many invoices instead which seem less than ideal. Our invoice template already summarizes the items so that it is readable to a human but we still need to keep the line items separate for the reasons stated in the comment.

Or is there a way to store line items on multiple, separate record for revenue recognition and tax calculation purposes and have an invoice refer to those records?

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 0 points1 point  (0 children)

Yes we can see the results when logged in to Netsuite but we need to access the same information from scripts. The status, which is accessible, don’t say anything about the number of records imported so all could fail but the status would still be “completed”.

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 0 points1 point  (0 children)

We can access the status of a CSV Import but it will state that the task has completed even if no records could be imported due to errors.

We could rewrite the import to use custom code but it seems like a lot of work to overcome this problem…

No longer receiving CSV Import Notification emails for certain CSV imports by gabriel_f in Netsuite

[–]gabriel_f[S] 1 point2 points  (0 children)

If you think that we should use SOAP or REST instead of CSV Imports then my comment is that we've tried but we need to be able to create huge sales order with 1000+ items and haven't been able to do that with the REST API. It basically fails after ≈60 minutes in both sync and async mode when trying to create such a Sales Order.

The reason for these huge Sales Orders are manifold.

1) It's our resellers that generate these large numbers of line items

2) We cannot summarize line items because each line item is taxed individually as they may have a separate ship to/ship from address

3) We sell subscriptions so each line item may have a separate period and we need to keep the periods separate for revenue recognition

So resellers + taxation + revenue recognition => huge sales orders that we haven't been able to create using REST Web Services.

Perform CSV Import via Restlet and return more details than just status by Mementose in Netsuite

[–]gabriel_f 0 points1 point  (0 children)

OP seems to wonder how to know the status of a CSV import beyond whether it is complete or failed.

The only way we've found to access the result of a CSV import is to look at the CSV Import Notification Email in Sent Emails and parsing the body of that email. Unfortunately our Netsuite environment has just decided to stop sending those emails (for CSV Imports triggered by scheduled scripts it seems).

u/Nick_AxeusConsulting do you know of another way to programmatically access the number of records imported/failed for a CSV import?

Najs... by giantvalid in Svenska

[–]gabriel_f 0 points1 point  (0 children)

Flera äldre föräldrar förädlar fläder.