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
Cabbages and VHS
Aug 25, 2004

Listen, I've been around a bit, you know, and I thought I'd seen some creepy things go on in the movie business, but I really have to say this is the most disgusting thing that's ever happened to me.
what is the software goon discord? not in OP!

Adbot
ADBOT LOVES YOU

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

Cabbages and Kings posted:

what is the software goon discord? not in OP!

Which one?

Cabbages and VHS
Aug 25, 2004

Listen, I've been around a bit, you know, and I thought I'd seen some creepy things go on in the movie business, but I really have to say this is the most disgusting thing that's ever happened to me.

leper khan posted:

Which one?

the.... coding one?? :worried:

Macichne Leainig
Jul 26, 2012

by VG
I think this should be the Cavern of COBOL one, that's the only one I know of for programming specifically

https://discord.gg/sJ5sQbsR

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

Macichne Leainig posted:

I think this should be the Cavern of COBOL one, that's the only one I know of for programming specifically

https://discord.gg/sJ5sQbsR

There's the yospos one too

Macichne Leainig
Jul 26, 2012

by VG
Aw man I always forget about YOSPOS

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

leper khan posted:

Which one?

Shh, quiet!

Ihmemies
Oct 6, 2012

drat. I thought chatgpt was a one trick pony, until I asked some coding questions. What's wrong with this code? How would you refactor this? Can you explain to me, what happens in this code?

It doesn't hit the goal always, but it's quite helpful. It gives me ideas which I didn't think about, and tells me about things I didn't know even existed.

Like, I have this piece and I'd like to shorten it somehow. How?
Python code:
if self.is_index_valid(self.__data[y], x+1):
	sur.append(self.__data[y][x+1])

if self.is_index_valid(self.__data[y], x-1):
	sur.append(self.__data[y][x-1])            

if self.is_index_valid(self.__data, y+1):
	sur.append(self.__data[y+1][x])

if self.is_index_valid(self.__data, y-1):
	sur.append(self.__data[y-1][x])
Chatgpt suggests using a list of tuples to replace those complicated ifs:

Python code:
for i, j in [(0,1), (0,-1), (1,0), (-1,0)]:
	if self.is_index_valid(self.__data, y+i) and self.is_index_valid(self.__data[y+i], x+j):                   
		sur.append(self.__data[y+i][x+j])
Or can you explain this code to me which friend gave to me (without an explanation):

code:
index_valid = lambda list, index: -1 < index < len(list)

DoctorTristan
Mar 11, 2006

I would look up into your lifeless eyes and wave, like this. Can you and your associates arrange that for me, Mr. Morden?
This is going to be a horrifically vague question, but is there a good tutorial anywhere on Active Directory, OAuth2, client credential flow and all that? Everything I’ve found so far is either uselessly vague or assumes you already know most of the terminology. (Paid is fine - I can probably swing the training budget)

Background is that I have never had to think about authentication before, but now I’m trying to deploy some dash apps that need to make api calls that require authorisation against some other AD app and I need to gain some idea of what needs to be done here so I can ask one of the AD specialists the right questions.

Shadow0
Jun 16, 2008


If to live in this style is to be eccentric, it must be confessed that there is something good in eccentricity.

Grimey Drawer
I'm using Xtensor, which needs Xtensor-BLAS, which needs BLAS - and this is where I've hit a roadblock.

I followed the instructions here: https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio for building and installing OpenBLAS, specifically 1. "Native (MSVC) ABI". And now all the includes and libraries and CMake files are in C:/opt like it wanted.
I then added:
code:
set(BLA_VENDOR OpenBLAS)
find_package(BLAS REQUIRED)
to my CMakeLists, but it's telling me that it's not found.
code:
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find BLAS (missing: BLAS_LIBRARIES)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.25/Modules/FindBLAS.cmake:1346 (find_package_handle_standard_args)
Also, why does OpenBLAS claim these are Windows binaries? I still had to cmake and compile it myself.

But I tried setting the environment variables, resetting, everything I can think of. I'm not sure why CMake refuses to find the library and update ${BLAS_LIBRARIES}. I want to make this all as automatic as possible, but BLAS refuses to cooperate. Ideally, someone just downloads my repo and it pulls all the dependencies, but I'm not sure you can do that with BLAS?

Sleepy Robot
Mar 24, 2006
instant constitutional scholar, just add astonomist
Is there an API where I could provide a copyrighted source image and it returns a set of simliar royalty-free images?

edit: looking specifically for something like an API that uses machine learning, and not so much a reverse image tool or image library

Sleepy Robot fucked around with this message at 22:49 on Dec 20, 2022

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

Stable diffusion kinda does that if you squint

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
fiverr does also, no api though and it's not automatic

KillHour
Oct 28, 2007


Google Images has a Creative Commons option to filter on, but I don't think you can combine it with Google Lens. There are services that take an image and give back a description, that you could maybe use to search CC for?

cheetah7071
Oct 20, 2010

honk honk
College Slice

Shadow0 posted:

I'm using Xtensor, which needs Xtensor-BLAS, which needs BLAS - and this is where I've hit a roadblock.

I followed the instructions here: https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio for building and installing OpenBLAS, specifically 1. "Native (MSVC) ABI". And now all the includes and libraries and CMake files are in C:/opt like it wanted.
I then added:
code:
set(BLA_VENDOR OpenBLAS)
find_package(BLAS REQUIRED)
to my CMakeLists, but it's telling me that it's not found.
code:
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find BLAS (missing: BLAS_LIBRARIES)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.25/Modules/FindBLAS.cmake:1346 (find_package_handle_standard_args)
Also, why does OpenBLAS claim these are Windows binaries? I still had to cmake and compile it myself.

But I tried setting the environment variables, resetting, everything I can think of. I'm not sure why CMake refuses to find the library and update ${BLAS_LIBRARIES}. I want to make this all as automatic as possible, but BLAS refuses to cooperate. Ideally, someone just downloads my repo and it pulls all the dependencies, but I'm not sure you can do that with BLAS?

I don't know the answer to your specific problem, but, if it isn't too late, I recommend against using xtensor. In my experience it's a mess of confusing compiler errors any time you step out of line, and its high level functions aren't really any easier or faster than just writing a loop. Numpy has the advantage that it is a lot faster than writing a python loop, but a loop in C++ will compile to basically the same code that xtensor is producing, just without all the template soup. Maybe other people's experiences differ, idk.

That said, when I did try xtensor, it was header-only, and should be as simple to use as pointing to the correct include directory, without messing around building dependencies. It looks like xtensor-BLAS depends on xtensor, not the other way around. Though maybe BLAS is the part you want? It certainly looks like it provides more unique functionality than xtensor does. I could certainly see the template soup being worth it if you're doing some heavy duty linear algebra

cheetah7071 fucked around with this message at 22:47 on Dec 20, 2022

spiritual bypass
Feb 19, 2008

Grimey Drawer
I'm writing a network service that exposes itself on a high numbered TCP port and publishes itself on Avahi. Is there any reason not to choose a random port number at startup time?

12 rats tied together
Sep 7, 2006

the client needs a way to know the port, is usually why source ports are fixed instead of random

if you have some other way of distributing the port, that's also fine, or if you have a way to dynamically link the application listening to a load balancer or proxy device's configuration.

Shadow0
Jun 16, 2008


If to live in this style is to be eccentric, it must be confessed that there is something good in eccentricity.

Grimey Drawer

cheetah7071 posted:

I don't know the answer to your specific problem, but, if it isn't too late, I recommend against using xtensor. In my experience it's a mess of confusing compiler errors any time you step out of line, and its high level functions aren't really any easier or faster than just writing a loop. Numpy has the advantage that it is a lot faster than writing a python loop, but a loop in C++ will compile to basically the same code that xtensor is producing, just without all the template soup. Maybe other people's experiences differ, idk.

That said, when I did try xtensor, it was header-only, and should be as simple to use as pointing to the correct include directory, without messing around building dependencies. It looks like xtensor-BLAS depends on xtensor, not the other way around. Though maybe BLAS is the part you want? It certainly looks like it provides more unique functionality than xtensor does. I could certainly see the template soup being worth it if you're doing some heavy duty linear algebra

Xtensor forms the backbone of the whole operation. It's a neural network library, so pretty heavy duty linear algebra. But it all already works - on my own computer. I'm trying to make it so other people can download it and build it without a lot of steps, but it's this BLAS thing that's stopping me from doing that. :( (And also OpenCV...)

cheetah7071
Oct 20, 2010

honk honk
College Slice

Shadow0 posted:

Xtensor forms the backbone of the whole operation. It's a neural network library, so pretty heavy duty linear algebra. But it all already works - on my own computer. I'm trying to make it so other people can download it and build it without a lot of steps, but it's this BLAS thing that's stopping me from doing that. :( (And also OpenCV...)

sorry I can't help then! I was tripped up by you saying xtensor depends on BLAS and thought maybe you had mistaken what it took to depend on xtensor, when really you had just misspoken slightly (I assume)

Depending on what you consider "a lot of steps", it looks like BLAS is in vcpkg and conan, which might end up working better? That's basically kicking the can down the road, in that your cmake file would just try to find BLAS without hints, and you'd expect the user to set up a package manager and use it to build BLAS (perhaps with instructions in a readme, if you expect people who aren't C++ devs to be building this)

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat
I have another excel head scratcher, a customer gave me a list of around 400 entries. The entries look like this:

[code]
Location Type Bandwidth
SiteA normal 10
SiteA advanced 11
SiteB normal 12
SiteB advanced 20
SiteC normal 33
SiteC advanced 24
SiteD normal 52
SiteE advanced 45
SiteE advanced 25
SiteF normal 100

[code]

So the problem is I need to know:
  • how many sites and a specific list of sites just have type normal, type advanced, or have both.
  • the total value of each types bandwidth (ie sites that only have advanced, have X total bandwidth)

But the way it's setup, each line item is one entry, meaning if I just filter the column by "type" it won't tell me the detail I need. That will not let me know that the sites don't have one or the other. I think I can do it with a pivot chart, I'm fiddling with that now, but I figured I'd ask the thread.

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

Super-NintendoUser posted:

I have another excel head scratcher, a customer gave me a list of around 400 entries. The entries look like this:

[code]
Location Type Bandwidth
SiteA normal 10
SiteA advanced 11
SiteB normal 12
SiteB advanced 20
SiteC normal 33
SiteC advanced 24
SiteD normal 52
SiteE advanced 45
SiteE advanced 25
SiteF normal 100

[code]

So the problem is I need to know:
  • how many sites and a specific list of sites just have type normal, type advanced, or have both.
  • the total value of each types bandwidth (ie sites that only have advanced, have X total bandwidth)

But the way it's setup, each line item is one entry, meaning if I just filter the column by "type" it won't tell me the detail I need. That will not let me know that the sites don't have one or the other. I think I can do it with a pivot chart, I'm fiddling with that now, but I figured I'd ask the thread.

It's a pretty small number of entries. You should be able to walk the set to make two lists, one for being normal and one for advanced. From that you can make a third set with the intersection. The intersection gives you things in both. So then normal exclusive is normal - the intersecting set.

I sort of expect all of this is in excel. You can do the whole thing in excel, but in general excel is the programming language of people who don't style themselves programmers. So you may get better specific advice in BFC (i expect there's an excel thread?)

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Are you familiar with SQL? If not, are you willing to learn how to do some basic things?

nelson
Apr 12, 2009
College Slice

Super-NintendoUser posted:

I have another excel head scratcher, a customer gave me a list of around 400 entries. The entries look like this:

[code]
Location Type Bandwidth
SiteA normal 10
SiteA advanced 11
SiteB normal 12
SiteB advanced 20
SiteC normal 33
SiteC advanced 24
SiteD normal 52
SiteE advanced 45
SiteE advanced 25
SiteF normal 100

[code]

So the problem is I need to know:
  • how many sites and a specific list of sites just have type normal, type advanced, or have both.
  • the total value of each types bandwidth (ie sites that only have advanced, have X total bandwidth)

But the way it's setup, each line item is one entry, meaning if I just filter the column by "type" it won't tell me the detail I need. That will not let me know that the sites don't have one or the other. I think I can do it with a pivot chart, I'm fiddling with that now, but I figured I'd ask the thread.

You can make additional columns that are conditionally filled. Look up the “if” statement.
https://support.microsoft.com/en-us/office/if-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2

For example you could make a new column for bandwidth that copies the bandwidth data from the source if the corresponding type cell is “advanced” (otherwise default it to 0). Likewise you can make an additional column that does the same for “basic”. Then it’s trivial to do the sums for each.

E: Looks like there is an excel specific thread: https://forums.somethingawful.com/showthread.php?threadid=3132163&perpage=40&pagenumber=1&noseen=1

nelson fucked around with this message at 18:39 on Dec 22, 2022

Kuule hain nussivan
Nov 27, 2008

Can anyone recommend simple, practical metrics for measuring cohesion / coupling or a related concept. Basically, I need to do some refactoring and need something that can be used to show that the refactor does increase modularity in the monolith, other than "look at this code".

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Goodhart's law means there aren't really any "practical" metrics, especially if you're doing a refactoring with the end goal of saying "the refactoring improved the metric by this much".

Why do you "need" to do this refactoring? Typically the business justification for spending developer effort (and thus money) on refactoring is that it will pay for itself in better developer productivity and overall development velocity down the line. That's not something you can directly measure by looking at coupling between components or things of that ilk.

nielsm
Jun 1, 2009



Agree, you'd need to look at some aggregate metrics, that may be hard to collect, might lag behind the refactoring by months or years, and might only be partially correlated. Things like, average time taken to implement a story, average number of bugs in new features, time taken to get new developers up to speed on the code base, or send out questionnaires asking developers to rate their happiness working on the code.

Kuule hain nussivan
Nov 27, 2008

Thanks for the input. It confirm what I've been suspecting. The "metrics" requirement is coming from above my pay grade, for reasons I don't fully comprehend, but the main gist of it seems to be that they need something to tell them whether merging the code would make it better.

The actual business requirement is a bog standard legacy thing. poo poo's been in development for ages, technical debt, duplicate code etc. has piled up. This has made side effects a real issue and the codebase itself is absolute pain to understand. I think I'll try and recommend that instead of the metrics discussed so far we could use simple, real life examples such as "merging this will remove x cases of duplicate code, decrease entrypoints by x and simplify code by x lines".

spiritual bypass
Feb 19, 2008

Grimey Drawer
I've enjoyed CRAP scores in languages that have tools available to generate them. It's supposed to tell you how risky your code is based on things like nested control structures and test coverage.

boofhead
Feb 18, 2021

Kuule hain nussivan posted:

Thanks for the input. It confirm what I've been suspecting. The "metrics" requirement is coming from above my pay grade, for reasons I don't fully comprehend, but the main gist of it seems to be that they need something to tell them whether merging the code would make it better.

fe: bit of an unintentional rant on product management coming up, sorry in advance

In my very limited experience as a product manager at a few 3-10 year old, 15-200+ person startups (before I finally gave up on that poo poo and transitioned back into dev work), 'objective' measurements or logic is very hit and miss when it comes to getting priorities agreed to or extra resources allocated, unless you can put a simple money figure on it and say "this will make you $X for $Y investment" - and even then it's not guaranteed, if a higher up has a pet project/hatred or specific biases. The part I've bolded in your post is more important, in my opinion.. you gotta learn a bit more about who the human blockers are and what their motivations/mindset are, and tailor the proposal to suit that. Maybe it's different at larger or more grown up companies, but I think the base idea of "you're not feeding inputs into an anonymous machine that will return True if sufficient thresholds are met, you're trying to convince a few actual human being that this thing they don't want to do is actually worth doing" should still ring true most anywhere

It could be that they just need something on paper that people at multiple stages in the hierarchy can point to and say "yep passed all the requirements for due diligence on my side, my arse is covered" and that's enough, or it could be that someone up the ladder personally believes that it's a bad or useless idea and they're hiding behind the requirement for an arbitrary numerical justification.. in which case the proposals you make will never be good enough until you find a way to convince that person that it's in their interests, or haggle or find some way around them. This all involves talking to the people involved and the people who know them and it sucks hard, at every level, especially as you go up the ladder and have to deal more and more with the sorts of people you find at those levels in a company

I guess the point to this rant is that you might be putting the cart before the horse, or taking them at face value (when you maybe shouldn't). They might have said they need some sort of KPI justification but at the end of the day all that data is still being interpreted by one or more humans who will basically just do whatever they were already going to do anyway, so you gotta find out where the requirement is coming from and what the broad level of support/opposition for your proposal is. If someone in a business context tells me that they need an airtight, "the facts speak for themselves" (they never do) proposal, it immediately makes me think that there's one or more people up the ladder who would be very opposed to the idea, for one reason or another... so rather than spend time coming up with a magical unimpeachable data-based proposal, I'd first go around and talk to a few people, try to figure out what the environment is like and if there's some arguments that might work on the people who control the rubber stamp - and then whatever effort you put into the metrics (and the justification for the metrics) is a bit more targeted

real edit: oof that was a lot of words about previous professional trauma, when all I needed to say was "before you get too deep into figuring out what objectively 'true' metrics might look like, have a chat to some people in the know to figure out instead what some 'acceptable' metrics might be"

boofhead fucked around with this message at 14:40 on Dec 27, 2022

smackfu
Jun 7, 2004

https://en.m.wikipedia.org/wiki/How_to_Lie_with_Statistics

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Kuule hain nussivan posted:

Can anyone recommend simple, practical metrics for measuring cohesion / coupling or a related concept. Basically, I need to do some refactoring and need something that can be used to show that the refactor does increase modularity in the monolith, other than "look at this code".

if you have to ask permission before refactoring (especially your own poo poo), you might be in a hosed up development situation

smackfu
Jun 7, 2004

It’s a bit like someone saying, “prove this preventative maintenance will save us money in the long run before we approve it.”

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

smackfu posted:

It’s a bit like someone saying, “prove this preventative maintenance will save us money in the long run before we approve it.”

To be fair, it's not always unreasonable to ask for justifications. There's preventative maintenance, and then there's tinkering. There's also an opportunity cost. Even if refactoring the old thing means that future changes will be easier, and you'll end up saving a small amount of time overall, it may still not be worth the value of making a new widget or whatever instead.

Viginti Septem
Jan 9, 2021

Oculus Noctuae
Hello, I read a bit and looked around and I'm not 100% sure I'm in the right place or haven't found what I'm looking for at least. I normally chill in BYOB, but might need some further knowledge here.

Is there a discussion thread for AI/machine learning interfaces and GPU/parallel processing projects? My brother tinkers with stuff like RasberryPis and Arduino boards and just got a Jetson Nano GPU 4GB for machine learning stuff but he doesn't really have a direction for it. Curious to find some avenues for him to pursue.

I'm currently installing the InvokeAI (Stable Diffusion) interface as I want to see where I can venture with my photos and art from the AI side of things.

Thanks!

Slanderer
May 6, 2007
I want to make a chromium kiosk (running on a raspberry pi connected to a TV) for my friend's cat cafe. The idea would be to have it display a page that shows a list of adoptable cats and then automatically cycles through their photos and bios. I'd probably want to pull animal data + photos from google drive or something, but the web page would just be hosted locally (I'd probably run the web server on the same raspberry pi, or maybe a headless one if I wanted multiple kiosks). I'd want to generate the pages/page content dynamically based on the most recent data from google drive.

I haven't done any web programming since I was a kid though (i do embedded software), so I'm not really sure where to start. Any suggestions on threads (or other places) I should look for advice?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Viginti Septem posted:

Hello, I read a bit and looked around and I'm not 100% sure I'm in the right place or haven't found what I'm looking for at least. I normally chill in BYOB, but might need some further knowledge here.

Is there a discussion thread for AI/machine learning interfaces and GPU/parallel processing projects? My brother tinkers with stuff like RasberryPis and Arduino boards and just got a Jetson Nano GPU 4GB for machine learning stuff but he doesn't really have a direction for it. Curious to find some avenues for him to pursue.

I'm currently installing the InvokeAI (Stable Diffusion) interface as I want to see where I can venture with my photos and art from the AI side of things.

Thanks!

There's a general AI/ML thread that's probably your best match. There's also the scientific computing thread over in SAL that might also be worth looking at.

Viginti Septem
Jan 9, 2021

Oculus Noctuae

ultrafilter posted:

There's a general AI/ML thread that's probably your best match. There's also the scientific computing thread over in SAL that might also be worth looking at.

Thanks! 😎

His Divine Shadow
Aug 7, 2000

I'm not a fascist. I'm a priest. Fascists dress up in black and tell people what to do.
How do I get a bash for loop to sort 1,2,3,4...10 and not put the 10 first? It loops through files in a folder.

code:
COUNTER=1; for i in *.jpg; do #Do work#; let COUNTER++; done  

His Divine Shadow fucked around with this message at 14:19 on Jan 3, 2023

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
It's called natural sort. Apparently you should be able change the value of LC_COLLATE to get it to do natural sort but i can't find an explicit example of what to set it to. Alternatively, rather than using wildcard expansion, you can loop over the output of ls with natural sort
code:
COUNTER=1; for i in $(ls -1v *.jpg); do #Do work#; let COUNTER++; done  
When possible, it always pays to pad leading zeros in filenames to avoid this problem!

Adbot
ADBOT LOVES YOU

Computer viking
May 30, 2011
Now with less breakage.

You could also pipe ls through sort, it has arguments for different kinds of sorts that may be handy. In this case, ls *.jpg | sort -g should do what you want? (-g is "general numeric", it sorts by numeric value first.)

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