|
Those are all valid points, I'm way more comfortable in bash, but I do know python. I'll switch over to Python and see if I can make it work better that way. The main problem is that I can easily get the result I want from the API, but I need to query the API multiple times and keep appending the result to a list of results and return the entire list as a json. Probably like most things it's easier to do with python, I'll dig into it.
|
# ? Jun 29, 2022 14:17 |
|
|
# ? Jun 8, 2024 20:19 |
|
I'd do it in Node, but when all you have is a NodeHammer everything looks like a NodeNail
|
# ? Jun 29, 2022 14:46 |
|
Jerk McJerkface posted:Those are all valid points, I'm way more comfortable in bash, but I do know python. I'll switch over to Python and see if I can make it work better that way. Like sure, a simple for loop, or maybe a case statement is all fine. But once you try to get arrays into doing your bidding and quoting them properly that's when poo poo hits the wall and you should choose a better language. Personally I vote for Ruby, but Python is equally appropriate for this task.
|
# ? Jun 29, 2022 15:38 |
|
LongSack posted:It may be, and there are a number of good suggestions in that thread, so thanks for that link. Other jetbrains IDEs have this feature under "actions on save" in the settings I would really be surprised if Rider was missing it since afaik their ides for different languages are mostly based on the same codebase with just a few tweaks
|
# ? Jun 29, 2022 16:06 |
|
RPATDO_LAMD posted:Other jetbrains IDEs have this feature under "actions on save" in the settings You're correct. I went back to the thread that I (mis-)read, and it turns out they were complaining that it only auto-formats on explicit save and there is no option to change it to any save like shown in your picture. My mistake. Also, I think I found the extension that was causing the slow-down. I thought back to what I was doing when the slowdowns started, and I had installed a bunch of Syncfusion controls. I disabled the Syncfusion/ASP.NET Core and Syncfusion/Blazor extensions in VS Code and so far (sample size of one) no slowdowns.
|
# ? Jun 29, 2022 18:59 |
|
Anyone seen places do a couple weeks of remote pair programming either all day or part day to help onboard entry level people and get them up to speed on older/larger code bases? How'd it go? I've never done pair programming and they'd be working with me via Teams. We're a python shop that makes a lot of SPAs for dashboards and webscrapers, deploying to AWS Lambda and Heroku. Our code tends to have a ton of domain specific workflows/business logic in them so what got written when the system was first developed 2-3 years ago can be pretty daunting and docs can get rather stale.
|
# ? Jul 1, 2022 14:30 |
|
CarForumPoster posted:Anyone seen places do a couple weeks of remote pair programming either all day or part day to help onboard entry level people and get them up to speed on older/larger code bases? How'd it go? I've never done pair programming and they'd be working with me via Teams. Check if your IDE of choice has a live share feature, that's a lot better than having to watch someone else's IDE on a stream
|
# ? Jul 1, 2022 15:00 |
|
dupersaurus posted:Check if your IDE of choice has a live share feature, that's a lot better than having to watch someone else's IDE on a stream Thanks! What do you think of pair programming for onboarding?
|
# ? Jul 1, 2022 17:19 |
|
I'm having another dumb. using Bash, nothing fancy. code:
Found the issue, I wasn't passing arguments through properly, so the siteChk was actually blank. Gothmog1065 fucked around with this message at 20:04 on Jul 4, 2022 |
# ? Jul 4, 2022 18:48 |
|
Jabor posted:Secondly, does this absolutely need to be done in bash instead of some more appropriate scripting language that isn't 30 years old? Just wanted to float this, so I repackaged my stuff into a python module, actually two modules since one is for auth and the other is for the function. It's working better, and it's way easier to deal with json, thanks for the tips. One question I have is this, so basically I have a module called cloud_auth, so if you do this: code:
code:
My question is now, it's pretty simple in bash to do something like this: ./script.sh function -u username -p password And then have a function name defined as a variable and call it, so you can write a little tool script that uses your functions as a variable name: code:
code:
code:
code:
code:
|
# ? Jul 7, 2022 21:45 |
Use the argparse module
|
|
# ? Jul 7, 2022 23:30 |
|
Thanks for the tip, I already have arguements working and all that. My question was about using a function name as a string. I got my problem sorted, I needed to use getattr: code:
|
# ? Jul 8, 2022 13:53 |
|
Jerk McJerkface posted:Thanks for the tip, I already have arguements working and all that. My question was about using a function name as a string. I got my problem sorted, I needed to use getattr: They were probably trying to lead you to the method that the argparse module offers for this sort of thing: sub-commands.
|
# ? Jul 8, 2022 15:26 |
|
Did we have a cryptography/security thread? My current job would like me to basically implement a license management solution or assess the feasibility of doing it in house (without an authentication server) vs getting a third party solution like denuvo. I talked with denuvo but it seems like overkill. What we'd like is that the client (other businesses, not average consumers) negotiates a subscription plan with our company, so we give them a license key and when they enter it enables access to the content that they have a subscription for. (otherwise those buttons /levels/tools are greyed out) My idea for a presumably hilariously insecure in house solution I could probaby quickly prototype is assuming each product we sell has a unique I'd to it, that we know when we sell the device. So we use that Id as a sort of public key to encode the license information into something that looks like a license key code. When they the client enter in this key code the software will compare the devices ID and attempt to enter it as the key for the decryption. If its valid it will spit out the license information that lists the Available content they can access as well as the start date and duration of the license, otherwise it is invalid. This feels like a reasonable solution that would take relatively few hours to implement, avoids the need for an internet connection, and keeps honest customers honest. I don't think we care if someone can look at the disassembly and reverse engineer which open source encryption algorithm we used and write up their own fake license and encrypting it using their machine Id. Any major flaws with this? We sell devices only to a very small number of customers so this seems like a reasonable trade off to me in terms of the security threat envelop with is likely negligible chance to begin with.
|
# ? Jul 8, 2022 18:34 |
|
If you're genuinely not concerned, you can probably get away with a data structure containing licenced options + dates + device id etc, sign it and append the sig, and give the device a public key to verify with. Let SHA and Base64 do the work. It's not exactly secure since the customer could replace the Public and private key, but again if this is not something you need to stand up to scrutiny...
|
# ? Jul 8, 2022 19:30 |
|
Hey, I just found this code snippet, and I have no idea what language this even is. Does this look familiar to anyone? Edit: consensus seems to be that this is probably mathematica DearSirXNORMadam fucked around with this message at 03:07 on Jul 9, 2022 |
# ? Jul 9, 2022 01:33 |
|
Hey folks. I've been doing a lot of twitch watching via Streamlink as of late and was vaguely annoyed enough with having to pull out my phone to see who was on that I wrote a CLI app/python script to do it. If anyone would like to give it a look or kick the tires on it I'd be interested in getting some feedback. I haven't done anything beyond basic scripts in Python in nearly a decade so I'm sure things could be better. Things I know could be better: - Onboarding is a pain. I'm mulling over trying to have the program do that, but it's likely out of scope. I'm not really sure what could be done here beyond setting up an actual service to do this with an actual redirect URL, but again that seems out of scope (and I'd prefer to have this be "local" to each user). - Windows users have to preface the script call with "python3" because Windows, but I'm not sure if there is a better way to handle that. Just doing it sans preface just procs a python window to open and close. - The script refresh path doesn't auto retry once completed. I could wrangle this, but just having the user re-run seems to be the occam's razor approach. - The documentation probably.
|
# ? Jul 9, 2022 02:29 |
|
Mirconium posted:Hey, I just found this code snippet, and I have no idea what language this even is. Does this look familiar to anyone? Probably Mathematica but someone here will know for sure.
|
# ? Jul 9, 2022 03:35 |
|
Warbird posted:Hey folks. I've been doing a lot of twitch watching via Streamlink as of late and was vaguely annoyed enough with having to pull out my phone to see who was on that I wrote a CLI app/python script to do it. If anyone would like to give it a look or kick the tires on it I'd be interested in getting some feedback. I haven't done anything beyond basic scripts in Python in nearly a decade so I'm sure things could be better. What's your goal with this? e.g.: Publish something people who also have this problem might stumble across. Have a bitchin' GitHub to get a computer touching job. Camel case variables are a dead giveaway for newbie python coders. configPath s/b config_path or whatever descriptive name.
|
# ? Jul 9, 2022 04:55 |
|
CarForumPoster posted:What's your goal with this? e.g.: Strictly the former. I’ve considered looking into how getting things into pip or whatever works but I’d like some folks to get hands on with it first. As for the casing, is that “a thing” with Python? I vaguely recall being told camel was the way to go but that was a while ago and also scoped to C++ at the time.
|
# ? Jul 9, 2022 05:08 |
|
CarForumPoster posted:What's your goal with this? e.g.: but worm case is lawful evil and I won't abide.
|
# ? Jul 9, 2022 05:31 |
|
Mirconium posted:Hey, I just found this code snippet, and I have no idea what language this even is. Does this look familiar to anyone? Edit: It seems it may be Symbolic Lab Language which is build on top of Mathematica. quote:In one aspect, the scripting language is Symbolic Lab Language (SLL). dirby fucked around with this message at 04:00 on Jul 10, 2022 |
# ? Jul 10, 2022 03:58 |
|
I'm an idiot with Docker and containerization in general and wanted to try to set up a Joplin server on some personal VPS hosting. Instructions are here: https://hub.docker.com/r/joplin/server I don't have postgresql on the setup so I'd have to do that too. They have instructions about using docker-compose with this: https://github.com/laurent22/joplin/blob/dev/docker-compose.server.yml Can somebody give me a little summary of what I have to get into to properly configure that? Do I manually edit environment variables in that file, or is it assumed that I'd override those elsewhere? It's just that "${POSTGRES_PASSWORD}" looks like a special convention to me but it implies in the directions that I'll just type in my own poo poo manually in place of that stuff. I wanted to confirm before I make a mess. How would I then acquire the composed image and run it? I've probably spent four total person hours with Docker before this in any capacity so I hope that gives you some perspective of how silly I am.
|
# ? Jul 11, 2022 20:54 |
|
In general terms it'd be worth watching like a 15 minute video on docker compose on youtube, so you have a broad overview of what's going on In the specific case you asked, those are environment variables and it expects you to have defined those elsewhere. You can just replace ${ENV_VARIABLE_NAME} with the direct value itself, if you want. You can also put them in a .env file in the same folder as the docker-compose.yml file and just handle it that way with code:
|
# ? Jul 12, 2022 13:44 |
|
Not sure if this is the best place to ask, but I'm having an odd issue running a VB Excel program that connects to an Oracle SEQ database, and reads/writes to different tables. In short, the excel file is used to append lines of data to specific tables in the SEQ database. There is a header record, and every header can have multiple lines associated with it. The first step is to connect to the database, open a recordset (rs) then retrieve a control number from that table, and put it into cnum (integer variable) code:
The next step is to build a new recordset entry and append a new record to a different table. Because there are (potentially) multiple lines associated with the headers, one of the first steps is to increment the cnum value for each line. code:
While running the program in VB, if I hover over cnum, it shows that the value is 516.00001 - which is what I expect it to be. However, when I go to the database and look at the value that is being entered, I get code:
code:
|
# ? Jul 12, 2022 16:15 |
|
516.00001 is not representable as a floating-point number, and 516.00000999999997 is the closest possible one.
|
# ? Jul 12, 2022 16:27 |
|
CzarChasm posted:Not sure if this is the best place to ask, but I'm having an odd issue running a VB Excel program that connects to an Oracle SEQ database, and reads/writes to different tables. That sounds absolutely awful and I sympathize. But in regards to the issue you are describing, it looks for all the world like a floating-point accuracy issue. Are these scripts treating something as a number when that thing is really meant to be either a string, or a tuple of integers? code:
https://docs.microsoft.com/en-us/office/troubleshoot/access/floating-calculations-info https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems https://stackoverflow.com/questions/588004/is-floating-point-math-broken
|
# ? Jul 12, 2022 16:31 |
|
Thanks both for the quick replies. I'll check out those links right away.Hammerite posted:That sounds absolutely awful and I sympathize. Thanks. It's a new job for me, and hardly the worst programming job I've had. Though the guy before me never started any of these with option explicit, so I have no idea how some of these programs were running at all. Narrator: they were not
|
# ? Jul 12, 2022 16:41 |
|
Float values are really bad for use as identifiers. If you are testing a float for exact equality with something you are probably using the wrong datatype.
|
# ? Jul 12, 2022 16:44 |
|
kaschei posted:Float values are really bad for use as identifiers. If you are testing a float for exact equality with something you are probably using the wrong datatype. Yeah, I looked back and the variable is being declared and imported in as a string value. And I have to ask why. It's stored in the DB as numeric, math is being performed on it, why is it being assigned as a string?
|
# ? Jul 12, 2022 16:51 |
|
Does anyone have a good formula for audit logging of the "every time a db row changes" or "every time an authorized valid CRUD request (at whatever coarser level) is executed, with some relevant data"? From what I was reading I thought maybe message queues were that answer, but it sounds like operating message queues has a lot of non-trivial pitfalls? Are those pitfalls tolerable in a case like an audit log? You wouldn't want, say, queued audit messages being dropped - but ultimately if the system is in a deadlock state (eg out of disk) there's nothing that can entirely be done. Trying to get a read on that use-case to understand the limitations better in other use-cases, like that seems like a straightforward message queue task. Needs to be finished, but async in the background on a non-DB thread is fine/great.
|
# ? Jul 15, 2022 08:29 |
|
The big question is that if you're in that resource exhaustion state, what would you prefer to have happen: - The initiating request is denied (no changes made, no data returned to the requester) - The initiating request succeeds completely, but no audit logging happens For a lot of scenarios where you're doing audit logging in the first place, that second option is unacceptable, which makes async logging a hard sell.
|
# ? Jul 15, 2022 08:49 |
|
I work for a DB company and every for-real audit log (so customers that actually do audits and not just the ones that pretend to) I've worked with has been part of the transaction itself, so ACID ensures that the log will always reflect what happened in reality. We would just store the audit as an entry in the database itself (with appropriate permissions so they can't be changed after the fact). For customers that really need to know what happened, we have the ability to version everything, so there is no real update or delete - just create and read. This is separate from the access logs, which always get written for every interaction, whether it succeeds or not (it's part of the network-level connection, so something would have to go really wrong for them to fail to write), but those obviously are very lightweight - just an IP address, destination port, endpoint, user (if available), and response code. If your DB is so beat up that it can't do logging anymore, you probably aren't in a position to serve the request anyways. KillHour fucked around with this message at 09:28 on Jul 15, 2022 |
# ? Jul 15, 2022 09:18 |
|
Very newbie question. I want to link a library. I've built the library which made these folders / files:code:
Anyone able to give me an explanation of how to link the .dll? what are the .def and .lib files? and how do I link to the headers too? (I'm an iOS / Xcode dev, so Visual Studio is very new to me)
|
# ? Jul 16, 2022 04:03 |
|
lord funk posted:Very newbie question. I want to link a library. I've built the library which made these folders / files: The dll needs to be in the same directory as the executable. Or some number of other places. The lib file is a static library. The def file is a definition file for the static library. Check the linker settings for the project.
|
# ? Jul 16, 2022 04:20 |
Headers are not linked into libraries. You distribute those as loose files for developers who want to use your library. The choice of whether your output is an EXE file, a DLL, or only a static LIB file is a project setting. (Or a parameter to the linker.) The DEF file is an additional input you can use when building a DLL, to specify what functions to export from the library. Only the functions you explicitly mark as export are available to call from consumers of your library. Instead of a DEF file you can use __declspec(dllexport) on your function declarations. When you build a DLL (or EXE) with any exported functions, the linker will also produce a stub LIB file that is used to link programs using the library. It points the linker to link the functions to the dynamic library.
|
|
# ? Jul 16, 2022 04:23 |
|
You need to #include the header file (possibly setting the folder containing it to be an include directory). You need to link to the .lib, which is in the linker menu and not in the C++ menu And finally, yeah, you need the .dll to be either in the same directory as the executable, or on the system path
|
# ? Jul 16, 2022 04:24 |
cheetah7071 posted:
But do not put your own DLLs into \Windows\System32, that is not your folder. It's logically owned by the OS.
|
|
# ? Jul 16, 2022 04:39 |
|
cheetah7071 posted:... which is in the linker menu and not in the C++ menu Ahhhh okay these are buried in the project properties. This did it -- finally telling the project where these files are and it's all linked up. Thanks.
|
# ? Jul 16, 2022 04:39 |
|
|
# ? Jun 8, 2024 20:19 |
|
nielsm posted:But do not put your own DLLs into \Windows\System32, that is not your folder. It's logically owned by the OS. Uh excuse me actually this is my computer so I will put my dills where I want THANKS
|
# ? Jul 18, 2022 01:26 |