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
Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
This is less a programming question and more of a question about how to manage programming.

I'm the senior developer in my group and up until now we've been 9 people, most of whom are project managers or "technologists" (folks with a grasp of new tech but not necessarily developers.) We're getting a lot more work now and as such we're bringing on new developers. Previously, development practices have been done cowboy coding style.

My question is, what are the best way to begin implementing development best practices in this environment?

I've already started the push towards implementing a system of shared git repos rather than individual ones and a local->staging->production development and deployment cycle, but my biggest concern is that some of the "technologists" have enough experience writing code that they're a danger to the process, especially since they're more senior than I am. Has anyone run into this before? Does anyone have any suggestions for handling this issue from a development and an organizational perspective?

Adbot
ADBOT LOVES YOU

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
So, here's a question. Is there any kind of implementation of XDebug that doesn't suck?

I spent hours trying to get it to work with Netbeans and still couldn't get it. I've got it working with PhpStorm but the actual IDE is kind of awful. All I want is to be able to set breakpoints and stop execution so I can check variable status. Shouldn't be too hard, right?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

rt4 posted:

Have you configured Apache and PHP to work with Xdebug yet? Does it work at all? Netbeans itself probably isn't the issue.

Yes, I have. Like I said, I've been able to get it to work with PhpStorm, just not NetBeans. Either way, the larger question still stands. Is there anything better out there than Xdebug?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
This feels like a really stupid question but I'm not sure how to do this within the bounds of the platform.

I'm working in WordPress and I'm trying to develop a global calculation "counter". The counter needs to persist across all users and be running at all times, but be dynamically counting when a user is viewing the site.

Normally I'd have a cron run a script every second or so to update a database then use AJAX to display the counter updating on the page, but WP doesn't seem like it offers something like this within its various APIs. Any thoughts?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
I've got a process question that I need help with. How do you guys go from higher level, general requirements like "we need this type of component" to discreet, low level tasks?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

the talent deficit posted:

I'm playing around with Vagrant and it's beginning to drive me crazy. Trying to use the chef_solo provisioner none of my `chef.add_recipe "foo"` declarations get added to the `run_list` in `dna.json` (in fact, there is no `run_list` key in `dna.json` at all). I feel like I'm missing something obvious.

I've been working on a vagrant build for LAMP stack development so maybe my example will help.

https://github.com/DBell-Feins/vagrant-php-master

Let me know if you have any specific questions about how I'm doing something in particular.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
I'm trying to wrap my head around designing an abstract dashboard webapp that allows a user to interact with data and design their own charts and graphs in an easy to use interface but I can't seem to figure it out. Does anyone have any suggestions for how to think this through or suggested reading for this kind of application design?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

KoRMaK posted:

Are you familiar with HighCharts? http://www.highcharts.com/

I am, but that's not what I was asking. My question has more to do with modeling the interaction between abstract data and visualizations. Ideally what I'd like to write is a rudimentary BI platform that allows users to investigate their data via charts, tables, etc. without having to write code.

I was going to write it on either Django or Spring, although I'm leaning towards using Python so I can incorporate analytics options using Pandas.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Pollyanna posted:

It's not that I want to use any one framework, I'm just looking for a way to keep JSON in a database. (Unless that's not a good idea?)

Users and login stuff can come later, I guess.

Let me preface this by saying that I think it's awesome that you're trying to learn how to program and that you've really thrown yourself into the task.

That said, I think you need to step back for a second and evaluate the way you're learning. It seems to me, based on reading your posts across various threads, that your method of learning how to program is:

  1. Figure out a problem to solve
  2. Find a technological solution that can solve that problem
  3. Go through tutorials until you solve the problem
  4. Repeat

While this is probably the quickest way to solve a problem, an education it does not make. My suggestion is that instead of trying to figure out how to get Knockout to talk to your Flask app or how posting form data works, you should really figure out the technologies you're working with.

For instance, you went into a project about storing data without thinking about how you would store it. I'm entirely unsurprised that you did that; it's certainly keeping in line with your "program the tutorial" process. But that's something you should think about whenever you start a new project. You have to know what you want to do at the most fundamental level and what technologies that will require before you think about how you want your app to look.

So, take your job app that you're working on right now. Here's where you're getting tripped up:

  1. You don't seem to have modeled your data in any real fashion outside of your knockout frontend. What does a single piece of data look like? Is there more than one type of data? How do they interact?
  2. You don't have any storage. When a user submits a new application, where does that data get stored? How does it get stored?
  3. You don't have ways of moving data from storage and to storage. What sort of things does your app need to do when given user input before it stores it? What does it need to do with stored input before it presents it to the user?

There are a bunch more, but I'm going to give you those 3 to start. Those are specific to your app, but there are a couple of other things you should address generally.

On a fundamental level, you don't seem to fully grasp the technologies that you're working with. JSON, for example, is primarily a transport format. It's a good way of dumping complex objects to a string while maintaining hierarchies. It's also schema-less. Another example of a transport format is XML, although it is schema-ed and should always have a strongly defined one at that.

I hope I haven't been too harsh, but I've started to feel bad every time I see you post about a new issue you can't figure out. If you really want to learn this stuff you should learn it. Don't just go through a tutorial.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

surc posted:

Is there a not-horifically painful way to read a hexdump?
I generally steer clear of hex editing, but apparently in order to get a server for the game "The Ship" running I have to edit one of the binaries with an updated ip address. :psyduck:

That goes in the Coding Horror thread.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

ufarn posted:

I just thought there'd be a better way to construct a URL conf with the number of keywords and arguments in it, and was wondering if there's a way to touch it up, now that it doesn't rely on query-based syntax.

To be honest, if you're that concerned with the number of keywords in your URI you should be implementing a system similar to a RBAC where you assign users roles which have permissions on system resources.

That way you can do away with spell-checkers/manage/16/ and implement it as a POST request where you specify an action (spell check) and check whether the current user can access that resource and do that action.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
I'm writing an API and also writing a frontend to consume it. In the future I'd like to write a mobile app that can work with the API as well.

My question had to do with how to secure data. Is this a case where Basic Auth and ssl will be fine or should I look into api keys or should I go even further and implement OAuth2?

If it's worth looking into OAuth2, what's the right way to think about it? I know OAuth2 has a bunch of different implementations and I'm still not 100% clear on how it works.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

sharktamer posted:

Hopefully I can answer vagrant specific questions here. I'm trying to use vagrant on windows here to run yeoman. I have set up a share to my code folder on windows which syncs a folder within the vagrant guest. When I run yo webapp in the synced folder, it's constantly giving me issues, while running it in a non-synced folder within vagrant works fine.

The output log of yo webapp when running in the synced folder
The Vagrantfile I'm using

As you can see from the commented out line below the sync, I've tried using the rsync shares. This gets me past the errors, but doesn't actually sync the files between vagrant and windows. I can run vagrant rsync to get the changes, but this defeats the purpose of using grunt and livereload. vagrant rsync-auto crashes, but I don't want to have it running in a separate tab anyway.

e: Once the project is created by using yo either in the rsync synced folder, then switching back to normal sync or just running in another folder and copying to the synced folder, everything seems to work fine. Still, not being able to run yo to create projects in the first place is a hurdle I'd like to get over.

e2: Scratch that, I can't even move over completed yo runs to the synced folder. Gives a load of lines like this:

mv: cannot create directory ‘/shares/coding/html+css/playbook/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test’: Protocol error

VirtualBox doesn't support symlinks in shared folders without admin privileges.

  • Shut down the VM
  • Add this to your Vagrantfile:
    code:
    config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME", "1"]
    in the vm config section.
  • run VirtualBox as admin
  • run your command prompt/bash shell as admin
  • Run "vagrant up" in shell

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

sharktamer posted:

Vagrant doesn't like that option, but it turns out it's default behaviour anyway.

I've run all the vagrant commands in an admin shell and nothing's changed. I didn't run VirtualBox as admin, but Vagrant takes care of running the virtualbox commands anyway.

I'm pretty sure that even elevated applications can't elevate other applications. When Vagrant runs VirtualBox it's still running the VBoxService as non-privileged. Run VirtualBox as admin and minimize it.

quote:

I have no problems creating and accessing symlinks in the synced folder. Just linked a folder in the vagrant home with one in the share, no issues at all.

Listen, I've been through issues with npm and installing npm_modules in my shared folder. It is 100% caused by VirtualBox not doing symlinks correctly in shared folders.

See:
https://www.virtualbox.org/ticket/10085
https://coderwall.com/p/qklo9w
https://github.com/mitchellh/vagrant/issues/713

Note comment by laithshadeed near the bottom.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

pokeyman posted:

All I can suggest without knowing the above is don't use XML.

I was like you, once. Then I learned the pain that comes with trying to parse a data structure without a fixed schema.

Until you surrender to XML you'll never know the joy of only having to write code to handle well structured data.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
I'm doing Python dev (web and scientific) and C# dev on the same rMPB. It's a great platform for pretty much any kind of development.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

ufarn posted:

If I'm a Python/Django guy who wants to play around with another web-centred programming language that runs better than a Ruby/Python framework, Go would be the most obvious choice, right?

Hearing some things about Rust, but dunno, but Go gets the most mentions.

C#

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Hughmoris posted:

Since my work won't give me any sort of read-only access to any of our databases,

You work for a hospital, right?

If so...

quote:

I've thought about creating my own as a learning exercise.

don't do it!

HIPAA compliance is real and you will get yourself and your employer hosed very hard if you screw around.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
Is there a better solution for a generic questionnaire schema than a Questions table, an Answers table, a Questionnaire table, a Question_Choice table, etc.?

I kind of hate how broad it is and how ridiculous it can get. this has to be a solved problem, right?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

nielsm posted:

I think these are the main purposes:
1. Regulatory compliance
2. Security for users on untrusted networks
3. Reduced risk of getting dumps of sensitive data through application bugs
4. Not seeing sensitive data if having to much about in the DB would be nice

3) and 4) are arguably handled just by separating the sensitive data into a separate table/data store.
2) by regular HTTPS.

It really the 1) that's the big issue, and I've just sent a letter to the national data protection agency asking for some specific guidelines on the types of data.

The actual data would most likely be "small fish", not something anyone would bother mounting an attack for. The purpose would largely be allowing the org to say they're taking reasonable steps for protecting the data submitted.

Is this for a government agency? If so, you should really have someone who's an expert in FISMA and related regs handle the auditing and communication with the agency's security team.

If not, you really shouldn't have the kind of onerous security requirements you're assuming you have.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
I'm going to be the voice of reason and say "just dont' do it."

Or, more specifically, make it extremely difficult for yourself to edit code on the server. Instead, you should be writing and testing all of your code locally and deploying to the server in one go.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
40k will net you a creative type that does programming in their spare time and might have an aptitude for learning.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

gmq posted:

I have been editing some javascript code that's very efficient but hard to understand. Basically it takes a nested json and with recursion it transforms it into a matrix of objects and arrays to make it easier to transform into an html table.

I work mostly in angular and other javascript libraries but this feels lower level, computer scienciesh I guess?

How can I get to the level where that kind of code is natural to me? What should I read?

Start with a naive solution that you can get to work, then account for edge cases, then find places you can optimize.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
I like Jetbrains stuff so even though I've never used it, you could take a look at CLion.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

ufarn posted:

This doesn’t seem to have done the trick - both the `sudo -H` trick and the chown one. For the latter, neither of the directories existed, so maybe something is wrong with the way pip is set up at the moment; `which pip` yields /usr/local/bin/pip, which should probably be pointing to my user dir?

My UNIX-fu is pretty awful, so how do I go about fixing this - short of just ignoring the problem by using virtualenv everywhere.

You probable forgot to source your virtualenv.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

crunk dork posted:

Right on guys. I don't actually do HTML/CSS for work but instead used to do it as a hobby kind of. I do more IT network admin type stuff at my job and am trying to get into infosec and pentesting so that's why I'm trying to learn, if that has any bearing on suggestions.

If you're looking at pentesting your best bets are python and ruby so you can write metasploit modules.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Thermopyle posted:

Source Code Pro

This is the only correct answer. If on OS X use the powerline version.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Munkeymon posted:

I was thinking you could essentially print money if you could make a system that could learn to reliably transform business data. There's already tons of money in that space, so if you could undercut Data Transform Consultants Local Number 5032 by 10% with the kind of margins that you could get by spinning up instances on AWS/Azure on demand you'd probably be raking in billions in under five years. I kind of doubt it's possible to do with ML in its modern state, but I'm no expert.

You're basically talking about every ETL platform plus maybe Drools.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Mr. Crow posted:

What (if any) conferences are worth going to these days? As a DevOps person? .NET?

I haven't been to any of the big ones so my perspective is likely skewed but I haven't found any of the ones I've been to particularly helpful or more interesting than just catching highlights or reading blogs on the internet.

For DevOps you basically have to go to reInvent. Hashiconfs are optional as are DevOps Days and Monitorama.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Steve French posted:

I'd check out Elasticsearch/Logstash/Kibana. I've had it set up and running at work for a few years now if you've got any questions.

Yeah the ELK stack is kind of the de facto solution for log transport, parsing, and visualization. If you don't want to handle running the ES infrastructure, AWS has an ElasticSearch service that works like RDS in that it abstracts most of the management and lets you focus on storing data.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Pollyanna posted:

This is a dumb question for me to ask so late into my career

Jfc this is a dumb question. Slow the gently caress down and learn something instead of trying to check boxes. You're on your second job in the software industry. You have plenty of time.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
Whether data is "Big" or not is a function of its size, complexity, and/or speed of production/ingestion.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

UberJumper posted:

Does anyone know if there is some sort of service/api that would allow my company to track issues relating to health/status of IoT devices?

I already wrote a bunch of health checks that get executed by AWS IoT, right now they just notify slack. Unfortunately that isn't good enough and people want/need to be able to see a history of the various issues that occurred on the device.

This project has been stuck in development hell for loving ever, so it has been dumped on me. What has been done is a :wtc: cthulu of spaghetti that tries to twist Jira into an IoT issue tracker.

Can AWS IoT publish to CloudTrail? If so, you could use that and consume those logs (I can't remember how long CloudTrail persists logs but probably not long enough for what you want) and store them somewhere. If not, what about SNS or SQS?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Thermopyle posted:

I was going to start writing a dashboard for one of my web apps to track application statistics (not things like response time or status codes...I know about packages and apps for monitoring/graphing this stuff, but things internal to my app like 'widget-processing-time' or 'users-with-red-hair' or 'response-time-of-3rd-party-api') but I thought I'd ask about if there's any good 3rd party packages or sites for this. Is spitting this stuff into a log and analyzing it with ELK or one of the hosted solutions a good idea, or are there more purpose-built tools for this?

That's basically why the ELK stack exists. I suppose you could also use whatever metric platform you're using and submit custom metrics then keep a rolling tally but you're shoehorning functionality when ELK does it for you.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Hughlander posted:

ELK isn't for dashboards despite what's said above. Try Grafana if you want to host yourself or Datadog if you want it hosted in the cloud.

I mean, that's basically what Kibana is but I agree with you. We use Datadog and they're great. I'd recommend them to anyone.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Paul MaudDib posted:

(Java here)

We have an absolutely crazy stew of code formatting styles going on in a project. I think we have at least 4 distinct combinations of indentation and bracing and we are only like a 6-person team, plus there's leftovers going back almost a decade. We even have mixed line endings everywhere.

At some point we're looking to fix a bunch of this (especially the line endings) - probably once the other team working on an earlier release gets their build out the door. But it'll be an indefinite period of time until then, and we're also not super thrilled about nuking all the git-blame information by normalizing everything, plus I worry the problem will only recur over time.

I really think we need something like checkstyle to keep us all mostly on the same page. Is this a viable way to standardize (and ideally enforce) indentation/etc? Most of the team is on Netbeans, I use a mix of IntelliJ and Netbeans, and another guy is all Eclipse. Is Checkstyle standard enough that we can get all those platforms to play along?

As for line endings - I personally think the proper fix here is "core.autocrlf=input" or "=true". Autocrlf-true has worked perfectly for me so far, I've actually re-done other people's commits to fix where Netbeans flipped out and renormalized the whole file (showed as 100% changed). I think Netbeans looks through the first 20 lines or so to decide what endings to use for a file - and if the wrong person adds something to the top of the file then it suddenly decides the file has the opposite format and changes all the line endings. When I soft-reset the commit to basically do a squash, suddenly my copy of git locks onto the actual changed lines instead of seeing everything as changed.

The one Eclipse guy runs Linux and he wanted to try a gitattributes approach - but that actually seemed to cause everything to normalize in a way that autocrlf didn't... is there anything we can do here to unfuck some of the formatting without totally screwing up our git-blame log? I personally find it really helpful to look back and see who wrote the code, what it was for, and how stale it might be, and we would instanuke that by reformatting line endings.

Personally I love the way IntelliJ does its code folding. I feel like a good fix until then might be for IntelliJ to just automatically reflow all the indent-soup back to some standard norm, but just in memory, without actually changing the files on the disk (unless I edit a particular block by myself). Is this possible with IntelliJ and/or with something else? Some combination of code reflow and a smarter diff that is less sensitive to whitespace/noise somehow?

I am also using Patience Diff right now and that's a big step forward in a lot of ways but it's still not perfect. Basically it tries to lock onto "high-content" lines that occur one time only in both versions of the file (things like function declarations), and then uses those as guideposts to subdivide the file into "zones", and then recurses on down. The idea being that it latches onto actual content instead of brackets and stuff. Much better than standard diff IMO but I would need something even finer, pretty much on a token-by-token level, which I think inherently limits me to something like IntelliJ that is content-aware...

You should be using a three pronged solution. First, to enforce local sanity, use an Editorconfig file and .gitattributes file.

To enforce team consistency you should be using the Maven checkstyle plugin or Gradle equivalent to enforce style on builds. All modern Java IDEs will do checkstyle-based linting while you're writing code so you shouldn't need to do anything else.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

LP0 ON FIRE posted:

bash scp:

I'm trying to transfer a file from my local computer to a host server over scp with a bash command without a password, and use a key instead so it does not have to prompt me for the password every time. I followed these directions:

https://blogs.oracle.com/jkini/entry/how_to_scp_scp_and

What more do I have to do? It still prompts me for a password. I checked if the key exists on the server after transferring with ssh-copy-id, and I set the permissions to 400 (even though I think all the require is 600).

edit I ran SSH in verbose mode, and I can't see anything where they server sent a public key packet.

Unless you have your ssh config (~/.ssh/config) set to always use your key you'll need to run ssh with the -i flag and specify the key.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Suspicious Dish posted:

Unfortunately, we don't produce "code for a 6th grade reading level" like we do for books, so there's no definitive answer to this question. I can certainly give examples of code I found particularly easy to work on (my first codebase I found super easy to read and work on was an early version of notify-osd). I suggest something that's small in scope and fairly early on in development before feature or scope creep have happened.

I've heard the redis codebase (and anything by antirez) is particularly clean C code. From a cursory glance, it feels fairly nice.

Here's a terrible suggestion: start reading JSON parsers. Everybody and their pet cat has written a JSON parser (here's mine). It's a simple enough problem that you can reinvent the wheel in 10 different ways. My JSON parser is going to look different from json-glib is going to look different from json-c is going to look different than yajl.

Learn the different tricks. Learn your HAKMEM. Learn what ((foo + 3) & ~3) does. Learn your do { stmt; } while(0);s. For JavaScript, learn your if(~a.indexOf('foo')) and your

A lot of larger libraries have their meat in a few files, and a *large* bit of data structures and fluff in the other files. The hardest part of reading this code can be navigating to find the meat of the library. After 10 years of reading code, this is still mostly guesswork, experience, and a lot of grepping and searching. Keep a log of your travels and if you see something suspicious, jot it down.

Ugh don't use bitwise operators to coerce to a boolean. It's stupidly opaque and your language probably has a better way to do it.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
How long is the request going to take? If it's on the order of seconds > 5 I'd suggest returning a 202 while the external request is outstanding is probably the preferred method.

Once data is returned, persist it and make the response available with a 200 the next time the same resource is requested.

Blinkz0rz fucked around with this message at 18:03 on Jan 23, 2018

Adbot
ADBOT LOVES YOU

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Mega Comrade posted:

DevOps mostly. A lot of monorepo proponents don't mention versioning, build pipelines or how they handle things like git history rewriting.
A lot of proponents I see seem boil down to 'I can just pull it all and do my feature and push without thinking to much so it is better'.

I know there is no right answer for this question, its very much a 'what suits your culture better' but it's going to be a bitch to change direction once we start so I want to make at least an informed decision so in 6 months when I realise I chose the wrong one I know at least I tried.

Glad this was what you were looking for. Monorepos are terrible for automating targeted actions unless you have some really deep and dark CI magic that identifies the programmatic subunit of the repo where the most recent changeset occured. This means that anything you run against the repo in your CI environment will take longer and will exercise code that hasn't changed.

That may be fine early on, but it can be frustrating for developers when they can't get a passing check in order to merge their PR because it's queued up behind 3 other checks and a build from an hour before. That's probably fine if you have per-sprint, per-month, or per-quarter releases but not so great if you do continuous delivery.

Basically you should be asking yourself the following:
1. What are you attempting to accomplish by putting the microservices together versus keeping them apart?
2. How mature and well developed is your CI pipeline?
3. How frequent are your releases?

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