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.
 
  • Locked thread
hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

hackbunny posted:

on the client side Xcode works great, except for a few wrinkles. excessively minimalist UI maybe but I've seen worse. yet another command language to learn and no straightforward documentation (Microsoft has the best documentation. every single debugger command, every single error code or BSOD code, every single compiler warning or optimization switch is documented)

just found this lol: http://fuckingclangwarnings.com/

paging rjmccall, why don't you guys write some straightforward documentation of all the -W, -f, -O, -m etc. flags? why does the --help text for -fsanitize tell me to look in the manual, instead of listing the available sanitizers? why does --version print the version of llvm but not the version of clang itself? why does -fsanitize=address not work on ios (builds fine, but can't find the sanitizer's dll at runtime), but if I enable the address sanitizer from the workspace scheme it does? why isn't -fstack-protector on by default in Xcode, but -D_FORTIFY_SOURCE is? how bad is -fstack-protector-all really?

Adbot
ADBOT LOVES YOU

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
today i am the terrible programmer. i have a branch (we use svn), and i cannot get one of my files to commit to trunk. ive made whitespace changes, done a force merge, nothing gets my changes into the trunk. and its all made worse by the fact that we actually have like 3 trunks i need to move this through and they're all in different states. urgh.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

hackbunny posted:

paging rjmccall, why don't you guys write some straightforward documentation
documentation is probably the biggest weak point of anything llvm-related. clang's documentation of their language extensions is great, but the documentation of the command-line options is nearly nonexistent. libclang's api is nice, but the docs are basically useless due to being incredibly incomplete and frequently wrong or misleading. lldb basically just doesn't have documentation (there's an introduction, a comparison to gdb, and that's about it).

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





any serious software should have specification tests (given input a does this produce b?) and model tests (do the results of running random-but-valid operations against my thing match that of running the same operations against an abstract model of my thing?). anyone writing software where the cost of failure is high should read this cool and good paper: https://www.google.ca/url?q=http://...WDOXef21VDZLdqA

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

some men just want to watch the world burn

https://github.com/citizenmatt/resharper-clippy

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!
The other day I needed to do some debugging on my MIDI program I'm writing on a teensy

so I started just writing serial comments in that i could alternate comment out with the usbMIDI commands and in a few other small places just to check on if things did as expected

then, after upload, the controller would lock up and the VCP disappeared, making me enter 'programming mode' manually. eventually I get so frustrated I load up blink.ino just to see wtf
runs fine, VCP returns

start going through my code and commenting out changes, then realize I put a serial.print in the constructor of the custom piezotomidi object I created. the objects are declared before setup() even happens. sooooooo that explains the lockup

:whitewater:

PS: really need to use the debug/breakpoint features in visualmicro, haven't even tried them yet

redleader
Aug 18, 2005

Engage according to operational parameters

gonadic io posted:

Jesus christ scala xml literals are implemented poorly. They seem fine, until suddenly you spend three hours working out why a test is failing on two identical xml nodes:

code:
val string = <Tag>{"1"}</Tag>
val int = <Tag>{1}</Tag>
val literal = <Tag>1</Tag>
 
println(string)
println(int)
println(literal)
println(string == literal)
println(int == literal)


Prints:
<Tag>1</Tag>
<Tag>1</Tag>
<Tag>1</Tag>
true
false


P.s. The explanation to this behaviour (until I knew exactly what to Google for) was in a comment on a stack overflow answer from 2011

i'll bite. why?

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

NihilCredo posted:

some men just want to watch the world burn

https://github.com/citizenmatt/resharper-clippy



lol

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

redleader posted:

i'll bite. why?

I think it's because you need a string inside the braces, but a bare 1 isn't a string

akadajet
Sep 14, 2003


clippy powered ransomware

gonadic io
Feb 16, 2011

>>=

redleader posted:

i'll bite. why?

the capability for tags to have non-string types is implemented as tag contents are parsed as Atom[_]s but this isn't actually exposed anywhere as pretty much nothing actually uses Atoms except for equality (due to equality first comparing types iirc).

i guess the intent was to allow type attributes etc?

so <Tag>1</Tag> and <Tag>{"1"}</Tag> are both Nodes that contain the normal Atom[String], but <Tag>{1}</Tag> is a Node that contains an Atom[Int].
code:
(<Tag>{"1"}</Tag>).child.head match {
    case atom : Atom[_] => println(atom.data.getClass)
}
(<Tag>{1}</Tag>).child.head match {
    case atom : Atom[_] => println(atom.data.getClass)
}
prints
class java.lang.Integer
class java.lang.String

you can't even match on Atom[Int] due to type erasure lol

the actual xml that they generate is the same though so any amount of checking the attributes or types or string representations or anything won't show the difference. all of the equalities (==, xml_==, strict_==) will fail though! so basically you're forced to 1) never insert any non-string into your xml, or 2) only compare using string equality (so it's fragile to ordering, open/close vs empty tags, whitespace, etc, etc)

martin odersky said that he didn't like the behaviour, that xml literals were a mistake, and that work needs to be done on them soon (in 2007). i guess most people just pretend that they don't exist.

gonadic io fucked around with this message at 00:27 on Feb 21, 2016

fritz
Jul 26, 2003


WONTFIX. Working as intended.

elite_garbage_man
Apr 3, 2010
I THINK THAT "PRIMA DONNA" IS "PRE-MADONNA". I MAY BE ILLITERATE.
freeing memory is whoopin' my rear end right now

Soricidus
Oct 21, 2010
freedom-hating statist shill
I keep getting true and false mixed up

VikingofRock
Aug 24, 2008




Soricidus posted:

I keep getting true and false mixed up

Programming in Bash?

Soricidus
Oct 21, 2010
freedom-hating statist shill
nope, java. i just keep putting conditionals the wrong way round and then getting confused when the opposite thing happens to what i expected

it's always the little things

Jerry Bindle
May 16, 2003
that happens to me, too, sometimes. i actually quite rarely use conditional statements that are more complex than if(state == Thing.STATE_A) though. using a < instead of a <= hosed me up for a moment last week.

CPColin
Sep 9, 2003

Big ol' smile.
I always love when the planets align and something like this happens:

code:
if (!isNotAvailable())
{
   ...
}

Soricidus
Oct 21, 2010
freedom-hating statist shill
yeah, it's all about the negative verbs. i'm running into poo poo like "thing.setDisabled(thing.shouldBeEnabled)".

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

that feeling in yr brain when you think it makes more sense to create a isNegative() function, but you know it's gonna mess you up later when you actually call it

brap
Aug 23, 2004

Grimey Drawer
what about (< 0) is inadequate for you

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!

Soricidus posted:

yeah, it's all about the negative verbs. i'm running into poo poo like "thing.setDisabled(thing.shouldBeEnabled)".

I need to reread smart dog thanks for triggering me

VikingofRock
Aug 24, 2008




fleshweasel posted:

what about (< 0) is inadequate for you

Language without operator overloading?

necrotic
Aug 2, 2005
I owe my brother big time for this!
why is it that !someNegative() has remained so prevalent? i just dont get the thought process that leads to that instead of creating a somePositive() to call instead.

qntm
Jun 17, 2009
my favourite is when it turns out that the variable noRetries is not "disable retries" but actually "number of retries", or vice-versa

Soricidus
Oct 21, 2010
freedom-hating statist shill

necrotic posted:

why is it that !someNegative() has remained so prevalent? i just dont get the thought process that leads to that instead of creating a somePositive() to call instead.

it's because there are a lot of terrible programmers, op

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

necrotic posted:

why is it that !someNegative() has remained so prevalent? i just dont get the thought process that leads to that instead of creating a somePositive() to call instead.

probably because a "negative" value like undefined/null/zero/false is commonly where a variable starts, and people wind up writing the function around that assumption out of habit

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
or if they're using ruby they broke their skulls against poo poo like this

code:
class Foo
  def is_enabled
    @is_enabled ||= true
  end
  def disable
    @is_enabled = false
  end
end

foo = Foo.new
foo.is_enabled #=> true
foo.disable
foo.is_enabled #=> true

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

qntm posted:

my favourite is when it turns out that the variable noRetries is not "disable retries" but actually "number of retries", or vice-versa

this happened to me at least 3 times. before you said it it never occurred to me that the numero sign wasn't an exclusive thing to romance languages in this way

qntm
Jun 17, 2009
no wait my favourite is Perl

Perl code:
unless(!$obj->retriesDisabled() == 0) {
    # what
} else {
    # WHAT
}

ErIog
Jul 11, 2001

:nsacloud:
I have a crypto question. I worked on this today: http://cryptopals.com/sets/6/challenges/42/

I got it mostly working, but I'm using SHA256 so me finding a cube root with an algorithm I pulled off Rosetta Code didn't work. I can't find a cube root that leads to the proper and complete SHA256 hash. Most of the hash is there, but it kind of loses coherence past a certain point. I suspect that due to the length of SHA256 I'm making the problem harder than I need to, and it seems like SHA1 with the shorter ASN.1 and the shorter bit length would allow me to fit the data I need into the part of the number I have easier control over.

So my question is, is doing this exercise with SHA256 impossible? If it is possible, is it just a matter of me calculating the value of the garbage padding block by hand based on Finney's writeup of the exploit? Am I a terrible programmer for not being able to do that?

How is cube formed?

ErIog fucked around with this message at 11:32 on Feb 22, 2016

suffix
Jul 27, 2013

Wheeee!
works for me with sha256

make sure you're using bigints or equivalent, floating point calculations will not be accurate enough

i binary search to find a number whose cube is anywhere in the range of numbers that starts with the shortest prefix + message hash

jesus WEP
Oct 17, 2004


is it even possible to check a repo out for a vs project without fighting nuget for like 2 hours?

jony neuemonic
Nov 13, 2009

qntm posted:

no wait my favourite is Perl

Perl code:

unless(!$obj->retriesDisabled() == 0) {
    # what
} else {
    # WHAT
}

to be fair, never using unless-else is about the only thing that entire community agrees on.

but... yeah. it's definitely special.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

necrotic posted:

why is it that !someNegative() has remained so prevalent? i just dont get the thought process that leads to that instead of creating a somePositive() to call instead.

it's because someone else wrote the object you're calling somePositive on and you're not really responsible for maintaining that class so instead you write bad code

computer toucher
Jan 8, 2012

just found out about python virtualenv and it's p cool.

look at me, I'm a baby learning to crawl.

Bloody
Mar 3, 2013

St Evan Echoes posted:

is it even possible to check a repo out for a vs project without fighting nuget for like 2 hours?

hmm yup

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
https://twitter.com/37point2/status/701817966678118400

Shaggar
Apr 26, 2006

St Evan Echoes posted:

is it even possible to check a repo out for a vs project without fighting nuget for like 2 hours?

only if you setup the project correctly immediately after you created it. alternatively, the new project.json works way better now cause nuget is handled more consistently

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
More fun tales from dealing with 3rd party services

Me: this valid xml document is accepted but not all of the fields are obeyed
Rep: yeah, your field tags are in the wrong order in the address node.
Me: fair enough, that fixes it. Why does it silently ignore them rather than give a validation error? Do you have a schema so that this doesn't happen again?
Rep: yes: here's a sample request with some of the fields marked with <!-- Optional -->. Note the ordering of the fields.

gonadic io fucked around with this message at 20:05 on Feb 22, 2016

  • Locked thread