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
CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

flakeloaf posted:

hey computer

WHAT

how big is a char

A CHAR IS 0x001 BIG

char *anArray = new char[100];

OK

what's &anArray?

0x6000

convenient. what's the address of the first element

0x6000

and the second?

0x6004

wa.... wahat?

this makes perfect sense not sure what the issue is.

Adbot
ADBOT LOVES YOU

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
one of those is an array of chars and the other one is an array of char pointers.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

JawnV6 posted:

int* ptr1, ptr2;

this always bugged me enough that i would never declare 2 variables on the same line because of it.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Star War Sex Parrot posted:

im glad I've never had to touch a javascript or a php

it’s called “being a professional”

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

JawnV6 posted:

fake edit: i wanna say MISRA or similar disallows multiple declarations on the same line, but can't find the actual rule

I swear when I was messing with MISRA this rule applied, but maybe it’s a Mandela effect going on.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
no tabs, 3 space indent, no spaces between if/for/while and parenthesis, indent the brackets to the next level on the next line.

code:
if(bar)
   {
      /* nobody will ever want to read me */
   }

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Lutha Mahtin posted:

is there a way to auto format comments in jetbrains ides? in java files they support autoformatting when it's a javadoc comment, but not when it's a standard block or line comment. I've looked around and not found anything for it, which is super frustrating because the code to do it is obviously there

the main thing that drives me nuts is that i have to hand-janitor mutli-line comments if i ever edit them and change the comment to need more or fewer lines of text. the javadoc formatter does nice line re-wrapping

select all, code -> reformat code

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
phds are fine if you want to be in academics for the rest of your life and you hate writing good code.

but lol if you pay for your graduate studies, you'll never make the money back. if it's not paid for by the school it aint worth it.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
tool and library development is my favorite part about my job since I don’t have to be nice to the customers at all.

at this point most of my job is pointing people in the right direction or gesticulating wildly in front of a whiteboard about an algorithm or process. then whenever we run into a problem that doesn’t have a fix off the shelf (deployment tools, source code generators, etc) I get to throw my headphones on and just knock out a bunch of code, and is probably the only time where the requirements are actually 100% known at start

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
i need a java library that does parsing of html, it doesnt have to be perfect, i just want to set up a proxy webserver and use the library to replace some strings without compltely breaking the html tags.

i own a domain that is a parody of a very popular nazi discussion board and i'm going to have some fun with it.

any suggestions

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
i'd rather not work with a plang and have to set up uwsgi or anything like that

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

tef posted:

is https://github.com/rath/libxml2-java an option? well, any bindings to libxml2? i mean, it does the job

might work maybe, but im going to be working with parsing html written by racists so im going to assume it's not going to have closed tags etc

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Peeny Cheez posted:

Using a proper XML library for HTML is like trying to pick up hookers in a go-kart: it's probably not going to work and you look foolish doing it.

Go with jsoup.

ty. seems to be the consensus. going to make some skinheads realmad with this project.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
<p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br><p><br>

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
wow jsoup works great. almost got the html transformer part of my project done last night. just going to do one for the css and javascript then slap it in a netty webserver.

surprisingly enough, nazis make well formed html so i probably could have done it with a plain xml parser, but whatever

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
djgpp? that's a name i haven't heard in ages.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
maybe if windows wasnt a POS OS...

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
there's a very small number of companies these days that can justify running their own hardware.

anyone who argues otherwise are people whose sole skill is running such hardware, and are terrified of becoming obsolete, despite the fact that it already happened.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
you shouldn't be using whatever UI a service provides to manage your cloud infrastructure.

might as well just use the compaq stuffed under an interns desk at that point.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

floatman posted:

I have tests for a codebase with no abstractions, no dependency injections. Imagine MVC, but no models so controllers and views are directly touching database tables.
"Tests" are set up by loading XML files which contain database state before the tests are run. These XML files are loaded into a database which is complicated and many foreign keys, therefore if I "test" a feature that touches table A that has a dependency on table B, my XML file needs to have table A and table B state/data in it. If table B has dependency on table C, then XML file has A,B and C in it. And so on so on.

All these XML files are produced by hand. There is no way to use a tool.

The XML files load directly into the database. This means that when I load a state on which I perform my tests, there is no guarantee that this database state is actually legitimate in the application itself. There are no factories or repositories where I can use the same logic that production code uses to create conceptual data entries in a test environment.

As expected, this leads to developers hand crafting application state XML documents that serve as basis for tests cases that are impossible to ever happen in production, but these tests are apparently what is used to show that the feature works.
The sheer expense involved in writing these XML files also mean at most, only the happy path test is written and edge cases are manually tested by some QA on staging environments.

why you should define an xsd schema for your xml documents.txt.doc.zip.exe

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Finster Dexter posted:

That has almost nothing to do with why this is horrible.

at least you could generate the code to form the XML then instead of hand writing it

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
there’s no way I wouldn’t get into the exact same poo poo Mcafee did if i were in Belize.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
my first lovely programmer job was being a temp at a place optimizing sql queries to speed up crystal reports that were embedded in ASP 1.0 pages, which used COM objects for database access.

after 8 months the other lead devs left and I was the lead.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

CRIP EATIN BREAD posted:

my first lovely programmer job was being a temp at a place optimizing sql queries to speed up crystal reports that were embedded in ASP 1.0 pages, which used COM objects for database access.

after 8 months the other lead devs left and I was the lead.

Mao Zedong Thot posted:

extremely literal :same:

a bit afterwards half the company got sold off and i left because i didn't want to help with the transition because it was going to be a clusterfuck.

also my loving college was going to pay me more for research, with health benefits, and free tuition, so that sweetened the pot

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
sometimes i go a whole week without doing anything at all

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
of course there is

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

cinci zoo sniper posted:

9 months in, is absolutely baffled by and unable to perform such complex devops manipulations as "ssh into centos box and type htop to see ram use or cat a config file in known path to check the variables" (decade of professional it experience)

i'm working with another organization who has their "AWS IT Specialist" as our point of contact, and the guy didn't even know what an AWS access key was, where to configure the AWS client credentials, or how to use the AWS cli to assume a role and grab an auth token.

the guy is in charge of their AWS infrastructure.

i once watched him struggle with why their server couldn't reach some endpoint we had and its because he decided to put an EC2 instance in a subnet with no routes through a NAT or to the internet. he spent 30 minutes looking at his iptables configuration before finally agreeing that what he was doing wasn't going to work.

some people are so loving stupid, i feel like contacting his employer and throwing him under the bus for being so incompetent.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

MALE SHOEGAZE posted:

sorry i should have been more specific, i meant binary formats specifically, although it wouldn't need to be restricted as such.

it'll need to be custom built, unless the format is braindead simple at which point it's not very useful. also where are you sending such binary objects? would the tool need to support RS-232, JTAG, some other transport mechanism, etc?

i work with a few satellite comm providers and they provide some tools that lets you define a schema for messages and then generate the binary representation from a UI to send/read for testing. same thing with a lot of the embedded hardware we deal with.

the reason why postman works is because http is a standard.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

cinci zoo sniper posted:

nah, i with no qualms with acknowledge that the guy smart and a rock solid dwh architect/database anything really senior in general. i just wish he'd at least try to step outside of his comfort zone, he's extremely bad at doing that, and so non-windows things are still a black box to him, and so is communication with non-programmers

i meant making GBS threads on the guy i was talking about, not your dude.

my blood just started boiling when thinking of an "AWS system admin" who doesn't know AWS at all, besides logging into the GUI and following tutorials for EVERY. SINGLE. THING.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
i had never heard of dbt either but i looked into it last night.

it's not really an ORM as much as it is a way to organize a bunch of select statements via templates and then compile them, with some built in helpers to make iteratively copying data easier to handle in a standard way.

seems like its cool.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

MALE SHOEGAZE posted:

can anyone recommend exercises for getting comfortable with hex, binary, and their associated operations? They make me sick to my stomach but I just need practice. I need something like that vim adventure but for binary and hex.

do all the project euler puzzles in x86 assembly. you'll be a bit flipping wizard in a few days.

problem with binary operations is that they are often processor specific, unless they are abstracted away from you by the language, but even then, shifting a 8 bit integer to the left 9 bits will always be implementation specific.

ran into that a lot when i was debugging some code on an embedded machine that was giving weird errors but when testing the expressions in GDB it seemed to be correct, because GDB implemented bit shift THIS way, and the target processor implemented bit shift THAT way, doo da doo doo

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Symbolic Butt posted:

jesus I can't even imagine coding a sieve of eratosthenes in assembly

code:
#include <iostream>

unsigned int isprime(unsigned int num)
{
	unsigned int esp_, t;
	
	__asm
	{
		mov esp_, esp
		mov edi, num

		cmp edi, 1
		jz _no
		cmp edi, 2
		jz _yes
		test edi, 1
		jz _no

		xor ebx, ebx ; answer

		fild num   ;
		fsqrt      ;
		fistp t    ; test 1 - sqrt(num)
		mov ecx, t ; 
		inc ecx    ;

_0:
		dec ecx      ;
		cmp ecx, 1   ; loop
		jz _yes      ; 

		mov eax, edi ;
		xor edx, edx ; divide
		div ecx      ; 

		test edx, edx ; is ecx a factor of num?
		jz _no        ; yes it is, num isn't prime
		jmp _0        ; no it's not, loop and try next factor

_no:
		mov eax, 0
		jmp __end

_yes:
		mov eax, 1

__end:
		
		mov esp, esp_
	}
}

unsigned int _main()
{
	unsigned int esp_;
	__asm
	{
		mov esp_, esp

		xor edi, edi ; found primes

		mov ecx, 1
_0:
		add ecx, 2 ; don't try even numbers

		cmp edi, 10000 ; are we done yet?
		jz _found      ; if so, jump to end

		push ecx     ; 
		call isprime ; 
		cmp eax, 1   ; check for primality
		pop ecx      ;
		jz _y        ; number is prime
			
		jmp _0       ; number isn't prime

_y:
		inc edi      ; increase found primes counter
		mov ebx, ecx ; most recently found prime
		jmp _0       ; loop

_found:
		mov eax, ebx ; return ebx

		mov esp, esp_
	}
}

int main()
{
	std::cout << _main() << std::endl;	

	return 0;
}

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
i did not write this, this is from the project euler guy who answers all the questions in x86 assembly

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

MALE SHOEGAZE posted:

personally, i've found the functional approach incredibly useful to me throughout my career. i dabbled in haskell very early in my programming development, and while i remember little to nothing about haskell, a few of the functional concepts stuck with me and i think they helped me a lot, even when i was working on a terrible rails app. there are very few places where you can't escape from some stateful context into a pure function.

but you also probably need to learn standard OOP and MVC.

this, a hundred times this.

you don't need to be purely functional, but if you have stuff with side effects that populates values which are SOMETIMES needed, I will loving berate a coworker about this kind of thing to no end.

This stuff drives me mad:

code:
// this throws an exception! why?
Foo x = getFoo();
Result result = calculateValues(x);

// well you forgot to populate the missing fields first!
Foo x = getFoo();
enrichFoo(x);
Result result = calculateValues(x);
is it really so hard to do:

code:
Foo x = getFoo();
EnrichedFoo y = enrichFoo(x);
Result result = calculateValues(y);
even worse is things like:

code:
Foo x = fooService.getById(1);
Foo y = fooService.getByName("abc");
where both methods return the same type (and same represented value) but one of them has certain fields populated and the other one doesn't, with no indication at all what the difference is.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Sapozhnik posted:

You must absolutely make your unit tests deterministic. So yeah hard code some plausible minimal test cases into your code. In situations where randomness is required your classes under test must take an RNG as a constructor param and you should supply an RNG that was initialized with a hard coded seed.

also to compound on this, if anything is time-based (now(), etc), make sure whatever functions you write let you pass in the current time, so you can test it. basically:

code:
interface Yospos {
  long calculateValueForToday(ZonedDateTime now);
  default long calculateValueForToday() {
    return calculateValueForToday(ZonedDateTime.now());
  }
}

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Sapozhnik posted:

Well in that specific case it may be better to pass a Clock, but of course it depends on the exact task at hand

well yeah, i was trying to simplify it.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
best thing is that if you are writing with testing in mind, not only is it easier to test your code, it really enforces thinking about some design decisions that will improve your code in general.

you can also go overboard though: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition

I'm the
LoopContextStateManipulation.java
LoopContextStateRetrieval.java
LoopPayloadExecution.java

LoopCondition.java
LoopContext.java
LoopFinalizer.java
LoopInitializer.java
LoopRunner.java
LoopStep.java

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
we use phabricator at work and i'll never go back

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

bob dobbs is dead posted:

phab is good as hell but they note right there on their front page that they use php so "even babies and dogs can contribute (with supervision)"

for awhile on their site navigation bar there was a link just titled "pokemon" that just listed off different types of pokemon.

its a good piece of software.

Adbot
ADBOT LOVES YOU

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
this thread made me look into that emulator101.com page and now im designing UIs for a debugger in ANSI C.

thx, thread

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