New around here? Register your SA Forums Account here!

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
pseudorandom
Jun 16, 2010



Yam Slacker

VikingofRock posted:

I just started working somewhere that uses perforce and I'm having trouble squaring it with this kind of work flow. E.g. today I was writing some tests when I noticed that some existing code was broken, and then it turned out that the fix strongly suggested a small refactor. In git I would split that into 3-ish commits (something like fix + add tests for bug, refactor, add new tests). I'm not sure what the "right" perforce workflow is, though. Should I be splitting this work into multiple workspaces? Are large changelists just considered more acceptable?


Not sure if I understand you perfectly, but I believe what I would do for that would be create a new Task stream off of your Development ("master") stream, then make three change-lists for each "commit".

I see no reason for using additional workplaces, however when I was using Perforce we used workspaces VERY conservatively, so most of my knowledge comes from only using one workspace.

Adbot
ADBOT LOVES YOU

pseudorandom
Jun 16, 2010



Yam Slacker

VikingofRock posted:

I guess my more general problem is what do I do if I start working on feature B, and then I realize that it depends on feature A which is unimplemented and in the same file? Is it possible to submit the two features as two separate changelists, without throwing away my work on feature B?

Sorry if I'm getting some of the terminology wrong or overlooking something obvious; I've only been working with perforce for about a week.

Shelve the feature B change list, work on feature A and submit it when done. Unshelve feature B, resolve any merge conflicts from A, and continue working on B.

This is similar to the git stash feature. It'll save the edits you've made in the B change list, but revert the on-disk file back to the unchanged state. You can then check out that file in the Feature A change list and make any edits you'd like. Once you've submitted A, unshelving will bring back the saved edits so you can continue working on B.

gonadic io posted:

I'm making a twitter app. All calls to twitter have to include both app credentials and user credentials (if you're acting on behalf if a user).

This is fine when I'm running it on my own comp, and would be fine with a server model where the user clicks an oauth thing on my page, gives me their user creds and I make the requests.

However let's say I wanted to make it clientside. The trouble is, whether I did it via a script on a page or via a browser plugin, some user would be able to access the app creds and then flaunt their rate limit to get the app banned.

Is there a way to solve this? There are other browser plugins that block people on twitter, I wonder how they handle this.

Does Twitter not have something similar to public app key + private app secret? If I'm reading the Twitter docs right, they give you an "access token" and an "access token secret"; if the APIs you wish to access only require the "access token", which I'm assuming is safe to put in a public client, then you should be safe to publish that.

pseudorandom fucked around with this message at 17:29 on Mar 20, 2019

pseudorandom
Jun 16, 2010



Yam Slacker
I like Vue, at least for the little bit I've used it. Seems relatively straight forward and a little more light-weight compared to the other big frameworks. Plus I get to sit around being :smug: while everyone argues about Angular vs React.


Of course, if you want to skip javascript you could just compile Rust to wasm. :getin:


Sapozhnik posted:

Also make sure you use TypeScript and Parcel in your project as well.

pseudorandom
Jun 16, 2010



Yam Slacker

gonadic io posted:

I'm doing my first async http server/client/db thing in rust and am finding it pretty painful honestly: https://github.com/djmcgill/de-list-server

just the process of getting used to the hyper/tokio setup, and it doesn't help that the library I proofed out the sync stuff in hasn't updated it's async interface in a while so i'm having to reimplement it. i'll probably end up contributing my changes back as a pr i think but it's annoying to have to do

e: also i should have just used an error library (or just ignore all errors) from the beginning instead of ending up with poo poo like Box<(dyn std::error::Error + Send + Sync) in a bunch of places

I'm both a couple days late and too lazy right now to actually investigate your code, but is there any reason you're going lower-level with hyper/tokio rather than one of the higher level frameworks? Rocket was really easy for simple projects, but I've moved over to Actix for my more recent toy projects. I would definitely recommend using a framework for Rust web things, unless your project is a web framework itself.


Beamed posted:

This was 2008-2011

Look at this guy, graduating high school in 3 years.


I was 7-11.



Phobeste posted:

c++ metaprogramming is incredibly good but unfortunately it requires a lovely perfectly smooth brain. marble-like, hard as a rock. this is enlightenment

I'm wonder how the developers are doing at my previous employer. Once I got a good grasp of templates and metaprogramming, I started using a lot of it. I tried to document it well, as I had already been thinking of leaving (and I have compassion and empathy for other devs), but I'm still curious how they're dealing with the damage I left behind.

pseudorandom
Jun 16, 2010



Yam Slacker
Edit: Removed; I'm probably too inexperienced/dumb to comment on this.

I'll keep this from my original post:

I'll admit, I've never worked in an Enterprise environment, so maybe I just don't Get It.

pseudorandom fucked around with this message at 05:12 on Apr 10, 2019

pseudorandom
Jun 16, 2010



Yam Slacker

TheFluff posted:

I don't seem to have made the difference between a query builder and an ORM clear. A query builder has an API that maps very closely to SQL statements - the goal is to manipulate a SQL AST. It's a metaprogramming tool, focused on generating programs (queries). An ORM on the other hand has an API that focuses on abstracting away the SQL in favor of an API that focuses on models and their relationships. It's a mostly declarative data modeling tool, based on the assumption that if you describe the models (tables) and the relationship between them then it's straightforward to generate a fairly limited set of functions to traverse those relationships. This assumption obviously does not hold, and in fact breaks down pretty much as soon as you see a many-to-many relationship. You end up restricted to an incredibly small subset of SQL - the forms that the ORM knows how to translate into simple model relationships.

I've used both and the ORM style is extremely limiting while not really making things any easier than the query builder style. Most query builders also come with things like model classes and that sort of thing too. Like, seriously, if your SQL toolkit can't even represent a semi-join without falling all over itself, it's loving useless. Even Django lets you do that, although it's awkward and I really wish I could have a real query builder instead of their janky poo poo.


This is a better way of stating what I edited out in my previous post.

I have never worked with an actual ORM, only a query builder (Diesel)--based on me now understanding the difference as explained in this quote--all of my career experience has been writing raw SQL. With this limited experience, a query builder really only makes sense to me in a strictly typed language where it can enforce types and objects/structures. An ORM seems limiting in all cases I can imagine (especially in loosely typed languages), and a query builder seems like a more complex and limiting way to write SQL but with possible benefits from language-level constraints. Per my previous comment, maybe I haven't worked on a large enough team or enterprise-y enough project to understand the offers of these tools.

pseudorandom
Jun 16, 2010



Yam Slacker

Space Whale posted:

The only reason this threadshit got checked in was nobody was doing code reviews, or, the people at $JOB when it was fully startup mode honestly didn't understand this - none of them.

Which scares me.

That's the dictionary definition for "startup". Unless it's started by a group of software engineers, they always start with one confident guy who builds the whole company's software with no oversight.


Then a few people are hired on, and they deal with the spaghetti and meatballs cooked by the CTO (presumably his title).

Startups live or die by the stage after that in which one hero must essentially rewrite, or completely refactor, the product to make it maintainable.

pseudorandom
Jun 16, 2010



Yam Slacker

Plorkyeran posted:

these sound like things that could result in a crashed plane if you gently caress up enough



Space Whale posted:

Oh, very much so.

:q:




Side gig idea: start a website where for a few bucks a search you tell me if I should be afraid of taking certain flights. :wink:

Edit: more afraid than my baseline fear for putting my life in the hands of software.

Space Whale posted:

So basically just loving rip the thread

:rip:

pseudorandom
Jun 16, 2010



Yam Slacker

Wheany posted:

i spent all day making a progressbar for our webapp's bootstrap script loading the actual ~1 MB (compressed) js and css data. i develop it in firefox and when i try it in chrome, the loving browser reports the amount of uncompressed data in its progressevent, so the progress bar hilariously breaks way out of the right side of the containing div. edge worked correctly. ie 11 didn't work because i used arrow functions (and probably would have broken on promises next)

web "development" :chome:

It's things like this that ensure we all have jobs. Our livelihoods depend upon our unique knowledge of web Woodoo (it's like Web Voodoo but more politically correct in IE 10+ and Chrome 42.0/Blink 182.1). Web development is like if civil engineers had sidewalk cement that didn't support certain versions of bicycles.

pseudorandom
Jun 16, 2010



Yam Slacker

HoboMan posted:

guy here likes to inert into the db via stored procedures where there is only one augment which is an xml blob of whatever you are updating/inserting.
it skips having to do an explicit mapping and lets the same proc handle any number of items, but it still feels wrong despite not having anything specific to point to.
what terrible thing am i missing?
or is this fine?

e: the xml blob is automagically parsed and the data properly put in the appropriate columns, not just jammed in the db


Do you accept user input, and if so, have you tried submitting "foo</column><column>bar"?

pseudorandom
Jun 16, 2010



Yam Slacker

Share Bear posted:

is there a good generalized guide to writing docs that i could provide most high-school level english writing programmers i work with? i know this is a skill that people need to work on to improve

i've been going with saying "who (is this for, made it), what (is it for), how (to build and run it, add features), and why (was this made, what problem does it attempt to solve)"

we've only had how to build and run it up until recently


Most of what I write ends up being:

CRIP EATIN BREAD posted:

stream of consciousness style thats impossible to follow

But, that's still better than nothing.

One big emphasis I'd make is that if there were any points where you struggled or spent a non-trivial amount of time thinking about how to implement something, then you should somehow summarize the problem and some of the reasoning at lead to the implemented solution.

Depending on the type of documentation, a good expansion on the above suggestion is: if you took an answer from stack overflow (or other online resource), explain the problem you encountered, then include a link to the SO answer.

This is just brain storming, but for teaching others, a nice exercise might be something like having them attempt to document another peer's code, or to try to explain another peer's code after reading the other's documentations. Or, depending on how long the course has lasted, just give them some of their own code from earlier in the course and see if they can remember what the gently caress they were thinking, then see if they can think of some notes that would have helped guide themselves when re-reading their own code.

Documentation is about making the life of a developer easier, be it you, a coworker, a stranger looking at open source work, someone reviewing a PR, etc. It should be the calm, helpful narrator guiding you through a cryptic landscape. It need not be perfect, but it should provide enough additional context that the combination of it, plus the thing being documented, helps a reader understand why a thing was written as it was and/or what that thing does.

pseudorandom
Jun 16, 2010



Yam Slacker

florida lan posted:

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

the


really should be followed by


it may well be some other reason but i am astounded by how many people who work with web apps have just somehow never heard of cors and have never looked at dev tools to see the big angry 'hey you should check out cors' warning that pops up when its constraints arent satisfied.


Maybe I'm dumb and stupid, but I loving hate CORS so much. As far as I can tell, it is only good for awful legacy apps that accepted requests like `GET /delete-everything`. But, GOD FORBID anyone like me wants to implement a `DELETE` route or use a non-standard header, because now I need to manually whitelist poo poo and endure a preflight `OPTIONS` request before anything can happen. :argh:

Browsers should have just let the lovely enterprise web apps implode.

pseudorandom
Jun 16, 2010



Yam Slacker

Sapozhnik posted:

Certain attacks were always possible through malicious IMG tags or post forms or combining the above with URLs that cause http to happen on non http ports.

New stuff that adds additional potential attack vectors beyond what already existed has to prove remote consent first. This happens through same origin policy or cors for, well, cross origin requests, or the websocket handshake to prevent arbitrary JavaScript from generating arbitrary TCP traffic to arbitrary hosts.

Why does a websocket handshake begin with something that looks like an http get? Because a malicious IMG tag could already generate those against arbitrary ports on arbitrary hosts long before even JavaScript was a thing.


Even though I like to stay up-to-date with it, maybe I'm behind the times on web exploits. Like, I don't know any way to use an IMG embed to exploit something that's not a `GET` request. And for off-site form/img things, I assume you'd need to have already compromised the target host if you want to access the auth/session tokens for performing requests that result in changes being made.

pseudorandom
Jun 16, 2010



Yam Slacker

Jabor posted:

You do realise that the person who wrote a website might not be the same as the person accessing it through a web browser, right?


Yes? By "compromised" I was mostly referring to XSS and a malicious party gaining access to cookies/localStorage.

pseudorandom
Jun 16, 2010



Yam Slacker

HoboMan posted:

nginx:
i imagine it's supposed to be said like n-gin-x (engine x) but i can't help but read it as n-ginx (en jinx)

I'm pretty sure it's the "engine x" version, but drat you've got a good case for "once you see it you can't unsee it".

pseudorandom
Jun 16, 2010



Yam Slacker

VikingofRock posted:

Java question: I have a few large-ish functions, each of which I would like to call with two (possibly later more) different possible input types. The implementation of these functions would be largely the same when called with either input type, but there's just a small method or two in each function that would be different for each type. I know I could implement this roughly like this:

Java code:
void <T extends Baz> doOneThing(T input) {
  // lots of code...
  if (input instanceof Foo) {
    ((Foo)input).doSomething();
  } else if (input instanceof Bar) {
    ((Bar)input).doSomethingElse();
  }
  // lots more code
}

void <T extends Baz> doAnotherThing(T input) {
  // similar strategy here...
}
However, this feels pretty inelegant. For one thing, it doesn't scale well to more functions / more types. For another thing, it doesn't behave nicely if I pass it the wrong types: at best I can just make it fail at runtime. So what's the best strategy here?

A little more info: while Foo and Bar both extend Baz, Baz as a whole is very broad and most of it's subclasses won't work with these methods. I do not directly control Foo and Bar, so I can't e.g. make them both implement an interface which does what I want.

Does Java have Traits yet? Alternatively, I think C# had a way to define methods where `void exampleMethod(Foo someObj)` could be called like `myFoo.exampleMethod()`; though it's been a while since I've used it. Does Java have anything similar now where you could define methods for each class that don't require you to control their full implementation?

If not, it might be hacky, but maybe make a wrapper class, or classes, that you pair with an interface.

pseudorandom
Jun 16, 2010



Yam Slacker

Blinkz0rz posted:

this thread gets into dumb slapfights about which language or ecosystem or dependency management tool is better but it's all garbage and we should be talking about how we're doing our best to make our day-to-day lives better while we stack absurd amounts of paper


I think the problem here is the slap fights arise from trying to help someone by suggesting "better" day-to-day life tools, but then the person says "I can't" or "I have", and then everyone assumes they need to be institutionalized because they didn't immediately accept and adopt the one true language/package manager/build tool.


Rust and Cargo

Also

HoboMan posted:

pl thread is for language slapfights, this therad is for commiserating and or panicking about the terrible code we are all making GBS threads out (which is all code)

that said, shaggar is still right

pseudorandom
Jun 16, 2010



Yam Slacker

HoboMan posted:

ok, again i have not had to design poo poo before.

how to restfully have an endpoint that returns a resource filtered by another resource?


Assuming you're just trying to GET all of the resources that "contain", for lack of a more generic word, some other resource. In other words, searching for all resources that have some property that matches another resource.

I'd probably use one of two options depending upon what your actual use-case is. First would be a query param on the route for the resource:

/api/butts?kissed_by=[goon_id]

My alternative would be swapping the resources and use a nested route of the single resource by which you're trying to search:

/api/goons/:goonId/kissed_butts

I'd only use the latter if there's an obvious hierarchical relationship between resources. Like, if Bars only exist as children of Foos, then the latter would work (/foos/:fooId/bars). In basically any other case, like if Foos and Bars might be associated but could be coexistent without requiring the other, then I'd go with a query parameter.

The latter is also probably not strict REST but the internet is full of awful blog posts about how to do REST correctly and all of them have different opinions so I have no loving idea.

pseudorandom
Jun 16, 2010



Yam Slacker

eschaton posted:

the iPhone developer tools were and are good, hope this helps


I'll admit that I don't have a lot of experience with Apple stuff, but I'm pretty confident saying that their developer tools are bad. I worked on a team a couple years ago that released a game for iOS (iPad). My experience during that whole ordeal was that Apple dev tools are like Internet Explorer compared with modern Firefox/Chrome (even Edge). XCode and whatnot had some decent features, which were lacking compared to Visual Studio, but they only worked well if you were only developing using Apple's products (we were making a game in Unreal). It was always a bad day whenever there was an iOS/Mac specific issue and I had to hop over to our one Mac to try to debug it.

Also, Apple managed to make a hardware ecosystem that is very, very controlled down to the hardware of their own desires, yet (as far as I know) they don't offer a VM for iOS with XCode, thus requiring you to have a physical device for testing.

pseudorandom
Jun 16, 2010



Yam Slacker

CRIP EATIN BREAD posted:

they've had a ios simulator since like forever. its not a true vm but it runs your code.


I'll admit I'm probably The terrible programmer. It's definitely likely it has existed forever but I was too dumb to find it. But, I was accustomed to VS where I could just press F5 and a virtual mobile device would appear.

pseudorandom
Jun 16, 2010



Yam Slacker

eschaton posted:

what the gently caress is wrong at these places that things like a taxi ordering app wind up 2.3 MLOC?


It seems absurd when you call it a "taxi ordering app", but it makes more sense when you consider that it's a taxi ordering app, but sometimes the passenger is food, also maybe the car can drive itself, and sometimes the cars don't exist if you're actually working for Lyft of the police.

pseudorandom
Jun 16, 2010



Yam Slacker

Corla Plankun posted:

I have a $500 stipend for "educational materials' at my computer-toucher job. is there any better way to spend it than oreilly safari?

i tried a free demo of safari for a couple of weeks and it seemed very good but i grew up poor so i have tremendous anxiety when making any purchase over 16 USD

My city's library offers free access to Oreilly Safari to anyone with a library card. You might want to see if any libraries near you offer similar access before buying it yourself.

Is that a monthly or yearly stipend? In my personal case, I'd probably use it for online courses like Lynda, Udemy, or Coursera; or maybe buying the occasional relevant Humble Bundle. I'd also see if you could use it toward attending conferences for your field.

pseudorandom
Jun 16, 2010



Yam Slacker

Progressive JPEG posted:

no that's 0 in 100

it's for saving money on rent, nothing else is even a consideration


Eh, my last job was in an open office. We each had our own full size desk, so it could have easily been tiny cubicles instead, so it definitely wasn't to save money on rent.

It was to save money on furniture because ikea desks are cheap as poo poo and real office furniture is pricey.

pseudorandom
Jun 16, 2010



Yam Slacker

animist posted:

the worst data format i've had to work with recently is json-ld, which is the result of the semantic web people getting their greasy hands on json

code:
{
  "@graph": [
    {
      "http://schema.org/description": "The Empire State Building is a 102-story landmark in New York City.",
      "http://schema.org/geo": {
        "@id": "_:b1",
        "http://schema.org/latitude": "40.75",
        "http://schema.org/longitude": "73.98"
      },
      "http://schema.org/image": {
        "@id": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg"
      },
      "http://schema.org/name": "The Empire State Building"
    },
    {
      "@id": "_:b1",
      "http://schema.org/latitude": "40.75",
      "http://schema.org/longitude": "73.98"
    },
    {
      "@id": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg"
    }
  ],
  "@context": "https://w3id.org/security/v1",
  "signature": {
    "type": "EcdsaKoblitzSignature2016",
    "created": "2019-06-07T03:23:16Z",
    "creator": "ecdsa-koblitz-pubkey:020d79074ef137d4f338c2e6bef2a49c618109eccf1cd01ccc3286634789baef4b",
    "signatureValue": "IJY25idmG+Yvy9kB57yNB6WNRU9jLtb8Vv6BEEIus9mcQTIpyPr25H3tx876WA7c1DXl8Wcx7TPvOSovKQ3HbyE="
  }
}
yes, that is RDF embedded in JSON. it's also signed with the bitcoin elliptic curve because they're pushing this to the blockchain people for some godforsaken reason


I like how they aren't HTTPS urls.



I'm "http://schema.org/description"


quote:

EXAMPLE OF A DESCRIPTION
code:
 <script type="text/javascript">
var fo = new FlashObject("http://google.com/flash/preview-player.swf",... 
</script>

:psyduck: Yes, the Flash player definitely helps me understand what a "description" is.

I like how every time I try to "Preview Reply" for this message CloudFlare makes me prove I'm not a robot beep boop

oh boy, I sure do love identifying store fronts

pseudorandom
Jun 16, 2010



Yam Slacker

eschaton posted:

but what is a build system really but a whole bunch of terrible programming





You see, terrible build systems and terrible programming keep each other in check. Neither could exist without the other, but if either existed alone it would quickly React and destroy all of software development as we know it.

pseudorandom
Jun 16, 2010



Yam Slacker
this discussion is getting out of han

pseudorandom
Jun 16, 2010



Yam Slacker

Ciaphas posted:

i'm searching almost 15 year old C memory here. do execv() and friends do anything to the process space's heap? or is that platform/impl dependent

i'm chasing a memory corruption bug that only appears when this library emergency-restarts, and the final call is just a plain old forkless execv. i've not seen this before, and i think it's causing an uninitialized pointer elsewhere to look initialized after the image is loaded and starts running, if that makes sense

code:
      execv(g_hMotionWnd, "\\hard disk\\boamotion", gMotionSettings->argv);
(it also seems like a "clever" way to restart a program, scare quotes intended, but idk on that one, might be standard procedure)

Is the program crashing on that line? If not, is it happening in similar areas in your program?

Is the memory being corrupted in the memory of the main process, or the memory of the library? My complete shot in the dark guess is the library might be returning (or consuming) a pointer that's being held on to which shouldn't be.

pseudorandom
Jun 16, 2010



Yam Slacker

Ciaphas posted:

I've not encountered this professionally, somehow, so I'll just ask


when you've got a bug like this that you think you've put in enough defensive code to prevent relapse, BUT for whatever reason you can't reproduce the original bug in the first place, how is my time best spent going forward

- find the drat bug come hell or high water, doesn't matter how unlikely it is to produce in the Real World
- code defensively, put in traces, keep an eye out, and hope like hell it doesn't happen again while I get some other work done


I guess this is more a 'depends on your manager' question, huh

Much like others have said, option 2. I've encountered bugs like that a few times in my somewhat limited professional experience, and that's generally the best answer. First, if you try to focus all of your energy on a bug and track it down like Moby-Dick, you're just going to start being blind to issues and will essentially burn out on it, thus wasting most of the effort you put in on it. Second, if you think there's a chance you fixed it via option two, then at least deploy it and see if occurrences of the bug decrease in frequency (:rip: if they increase); hopefully you have some kind of logging or error reporting that will let you see crash frequency and core dumps etc.

Basically, once you've accomplished option 2, which I think is generally a subset of option 1, then you should just work until you feel like you're literally just guessing. Once you're there, as frustrating as it may be, it's time to step back and focus on something else to clear your mind's palette. If the bug keeps occurring, then, hopefully thanks to option 2, you'll have more diagnostic data available AND a fresh, relaxed pair of eyes when reviewing the bug areas again.

pseudorandom
Jun 16, 2010



Yam Slacker

jit bull transpile posted:

I'm not usually one to make fun but


isn't this guy the one who casually admitted to farming his job out to a team of cutrate Brazilian programmers without telling his employer? did he really think he could run that con on Amazon?


The correct answer is to pipe the string queries into an Amazon SQS queue, which is read by an Amazon Lambda serverless script, which then uses Mechanical Turk to have people balance the brackets. Then, you sell this Bracket Balancing as a Service online, and charge the interviewer $0.0001 for each of their queries.

pseudorandom
Jun 16, 2010



Yam Slacker

Blinkz0rz posted:

i'll be the terrible programmer and say that i honestly don't understand what the practical case for an uninitialized guid is in c#

is it just so you can preallocate a collection of them and defer the call to the rng to when you need to use them? if so that feels really weird. i have to assume the clr introduces enough of an overhead that the performance impact would be negligible...


I'm feeling the same way about this whole conversation. Why not just make the default constructor all zeros (four 0x00000000)? It seems perfectly logical that a default constructor for any object would be the closest value that is conceptually "zero" for that class-type. Is allocating 128 bits of zero still too much overhead, or am I misunderstanding "uninitialized" in this context?

pseudorandom
Jun 16, 2010



Yam Slacker

Blinkz0rz posted:

but why is that something you'd want to do in the first place? it feels like a weird consideration for something whose existence and use relies entirely on randomness

like, have System.Guid() create a default v4 and have an alternative constructor that accepts null and spits out all zeroes or something or like System.NullGuid() or some poo poo

or take it a step further and don't even have a guid type; just have a bunch of guid helper methods that spit out strings

Just because the concept of a Guid means globally unique, doesn't mean the container must always be globally unique all of the time. It's just holding a value.

Let's say I have a CSV file containing a list of people: "guid, first name, last name, butt". This list may have thousands of lines. If I'm trying to load this CSV, and I don't want my program taking the computational time to generate thousands of new random guids, just so they can be overwritten with the "guid" values being read from the CSV.

Another example is sending the IDs over the network; the client might see the quantity of IDs being received, and thus pre-allocate an array for all of the IDs that it is receiving. Again, I don't want my client application generating thousands of random numbers that are going to be immediately discarded when the existing Guids are read in from the network.

cinci zoo sniper posted:

his code:



posting as images because clownflare blocks sqls lol

:stare:

Just wait until this guy learns how much more efficient queries are if it's written on all one line.

pseudorandom
Jun 16, 2010



Yam Slacker

Blinkz0rz posted:

a uuid should be a string generated by static methods depending on the type of uuid with other static methods to convert them to their other representative types


You keep missing the point that a Uuid object/struct/class is useful because they aren't strings. A trivial and easy implementation is a container of four 32-bit unsigned integers. The string representation you see is just formatting for human readability.

Making significant use of uuids and storing them as strings is terrible programming.

pseudorandom
Jun 16, 2010



Yam Slacker

Finster Dexter posted:

oh a billion new posts over the weekend, which argument did we re-hash this time?

1. spaces/tabs
2. vim/emacs/sublime/vscode/notepad++
3. p-lang x is dumb/not dumb
4. all of the above

it was a globally unique idiotic discussion.

pseudorandom
Jun 16, 2010



Yam Slacker

gonadic io posted:

Every programmer ever sees some dumb thing which isn't behaving the ways they want (usually for reasons they don't understand) and smugly says to themselves that they could do better. For fun reading check out the history of noisebridge's elevator

E: https://www.noisebridge.net/wiki/Elevator

akadajet posted:

lol if you get onto this thing


gently caress no :stonk:

I was in the audience for this talk, and it literally gave me nightmares that night. gently caress elevators.

pseudorandom
Jun 16, 2010



Yam Slacker

Sapozhnik posted:

is rust language server still hot steaming garbage


gonadic io posted:

Yes. For as long as this issue: https://github.com/rust-lang/rls/issues/352 is WONTFIX it will not be usable compared to jetbrains'. Rust analyser aka RLS 2.0 does fix it, but doesn't have IDE integration yet (and they might not build it, and instead use its lessons for a real RLS 2.0? https://ferrous-systems.com/blog/rust-analyzer-status-opencollective/)

Counter-point: No. It's been working very well for me.

Gonadic, are you using the VS Code extension mentioned in that issue? The kalitaalexey extension is 2 years out of date and unmaintained; the official "Rust (rls)" extension works much better. I just tried the minimal example from that issue, and auto-complete seems to work fine for the vec example.

pseudorandom
Jun 16, 2010



Yam Slacker

MononcQc posted:

In any case, all the recent major incidents from FAANG-style orgs were all blamed on "config changes" which points towards a shift in how people work around their dev pipelines towards less-monitored and manually-controlled roll-outs of complex features where rather than going through a code process for everything, you write code that can be tweaked through config, deploy that, and then do the old-style prod-fiddling via configs that are dynamic, untested, unmonitored (in comparison to code). Then when it blows up, you go "well, we need to make configs safer and testable" but it feels more and more that configs are a workaround or consequence of developer tools and pipelines with lovely ergonomics.

Sounds like they've adopted the Chernobyl process.

pseudorandom
Jun 16, 2010



Yam Slacker
I use {33c12562-382b-4547-a022-9ee5a3f67911} for true and {6d874ebe-060a-4e4f-bf6f-508951525f1a} for false. By ensuring uniqueness it helps protect against counterfeit booleans.

pseudorandom
Jun 16, 2010



Yam Slacker

Bloody posted:

i want a type in c# that i can use like a sql table. like i want some Collection<TIndex1, TIndex2, TValue>. like a dictionary with another index. is there anything im missing in the stdlib like this or a usable nuget package for this or do i get to roll my own bullshit

What are the indexes? Are you trying to be able to optimize a lookup based on two independent keys?

I might be the Terrible Programmer but, if the answer to the second question is yes, that's when I'd make a hash map of <TPrimaryKey, TValue>, and then a second map of <TIndex2, TPrimaryKey>; possibly even adding a third hash map if your primary key isn't space efficient. Unless you're in dire need of extreme optimization then 1 or 2 hash map lookups shouldn't be awful.

pseudorandom
Jun 16, 2010



Yam Slacker

CRIP EATIN BREAD posted:

I've never met a person asking about a K/V store that had a workload that even came close to requiring something other than a postgres table with the default database settings.


poo poo.

This is a fantastic time for this discussion to pop up, since I'm supposed to start implementing something like this soon. I managed to convince my team to go serverless for a new feature that's small but could have high volume. We were already planning to use a an AWS Lambda thing to handle intake, but I suggested using DynamoDB as a K/V store rather than doing some caching strategy to lookup data from our actual server+db.

The K/V store will likely only be storing a few thousand rows at most for the foreseeable future. I know I'm a terrible programmer, but am I the terrible programmer?

Adbot
ADBOT LOVES YOU

pseudorandom
Jun 16, 2010



Yam Slacker
Old MacDonald had a server farm


And on that farm he had a database



With an fsync here
and an fsync there
here an fsync, there an fsync
everywhere an fsync

Old MacDonald HAD a server farm

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