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
Posting Principle
Dec 10, 2011

by Ralp
i remember my first job was writing corba stuff in c++ for atc computers, i was a bad programmer then and i'm a bad programmer now

does anyone actually use corba 3.x or does 2.3 just continue to shuffle forward bc of institutional inertia

Adbot
ADBOT LOVES YOU

Posting Principle
Dec 10, 2011

by Ralp
proper k&r style isn't proper c# style

Posting Principle
Dec 10, 2011

by Ralp
std::vector<std::unique_ptr<myns::my_dumb_type<std::uint16_t>>>::reverse_iterator it;

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

so how long will it be before people realise that programming is a lifelong gravy train and wages then fall to account for increased supply of programmer? will this ever happen?

ceos are way ahead of this. when zuck supports immigration reform it's because he wants to deflate wages. the golden age of easy work for fat stacks is dying this decade

Posting Principle
Dec 10, 2011

by Ralp

gucci void main posted:

remote still being in the US? I think good communication (agile :barf:) helps that but really it shouldn't be that bad

I still kinda want to learn C# but I don't really know if I feel like making Windows Store Apps for Windows 8 Pro or Windows Phone 8 Apps for the Windows Phone 8. ASP.NET MVC gets you into the same exact realm as just doing Rails and at that point it'd probably be more worthwhile learning Play/Scala or something

assuming you basically wanna say gently caress anything but the 1-2 good phones right now, how miserable is Android development? basically right now I just want to make apps/anything that's not web apps and obviously iOS is the biggest market, but there's a billion iOS apps

android is somewhat sane if you limit yourself to > API level 14, but the docs still aren't as good as apples, and there's still nothing as good as grand central dispatch

Posting Principle
Dec 10, 2011

by Ralp
did u know you can do more than just java with eclipse?

Posting Principle
Dec 10, 2011

by Ralp
ios: a dying os

Posting Principle
Dec 10, 2011

by Ralp
once you've solved timezones can you start working on character encoding?

Posting Principle
Dec 10, 2011

by Ralp
i miss thinking that 10k lines was a big system

i dont miss thinking i know how to rewrite everything i come across instead of learning it

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

teheres not enough abstractions for 1+1

http://www.mikedoesweb.com/2012/jquery-math-finally-solved/

Posting Principle
Dec 10, 2011

by Ralp

uG posted:

i wonder how many people have seen both church numerals and the genitalia of the opposite sex??

Lots, usually on the same monitor

Posting Principle
Dec 10, 2011

by Ralp
there aren't many sane resources for c++ because it is not a sane language. someone who is better at it can step in with suggestions, but i don't think there's an easy way to learn it tbh

Accelerated C++ is good, the C++ Primer is also good and more modern (but very very dense). effective c++ and effective stl will give a nice overview of best practices and common patterns, but they assume a level of knowledge that you might not be at yet

i would say work through accelerated c++ (do the exercises) and then effective c++ and the wikipedia article on c++11. make it interesting for yourself along the way by doing small projects that interest you. maybe look into qt or some framework that interests you

once you're ready for some mind-blowing pick up Modern C++ Design and Exceptional C++

comedy answer:
get all of shrughes and that turkey story's posts from the c++ thread in coc and you've probably got a couple of good books

Posting Principle
Dec 10, 2011

by Ralp

JawnV6 posted:

its like those riddles where one of the guards always lies

Posting Principle
Dec 10, 2011

by Ralp
im going to learn ruby

Posting Principle
Dec 10, 2011

by Ralp
gcc is c++11 complete. libstdc++ is a seperate project, and is not

Posting Principle
Dec 10, 2011

by Ralp
before someone gets mad about using a 5 year old version of gcc, 4.7 produces just as obtuse an error

Posting Principle
Dec 10, 2011

by Ralp
http://stackoverflow.com/a/612196/1015660

if only there were some way to enforce constraints like this before runtime. oh well guess we'll just all have to pinky swear to name our methods right

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

we have 2 platforms that our c++ code has to compile on before it gets into production, one of which uses an ancient gcc extension that still complains if u don't specify a compile time const value when u initialise arrays.

use a vector and then just pass around the underlying array to whatever c bits you have. since you probably don't have c++11 on that platform, you can do a fake version of data() by passing around &front()

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

if ur work allows you to use c++11 then u my friend have a good job

for reals c++11 is the best part of my job

Posting Principle
Dec 10, 2011

by Ralp

Cocoa Crispies posted:

sorry your spergers is flaring up and mkaing you want enforced rules instead of loose guidelines

i also want const_cast to be a compile error unless you add a -imafuckingshithead flag but no one has accepted my gcc patch

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

boost::scoped_array m8

even msvc has std::array, how old is your compiler

Posting Principle
Dec 10, 2011

by Ralp
you're a braver person than me, i can't write c++ anymore without c++11 stuff

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

same but replace 'text editor' with 'lovely 70 dollar program that does the exact same thing as programs 40 years its senior'

does your job not pay for your tools?

Posting Principle
Dec 10, 2011

by Ralp
vs 2012 would be great if it shipped with a functional compiler

Posting Principle
Dec 10, 2011

by Ralp

Helicity posted:

seems to compile my lovely code just fine, i dunno what this even means

it means Herb loving Sutter works for them and they still don't have initializer lists

Posting Principle
Dec 10, 2011

by Ralp

perfectly cromulent code doesn't compile because microsoft is years behind apple and foss neckbeards

C++ code:
int main() {
	auto foo = vector<string>{"visual", "c++", "doesnt", "work"};
	copy(begin(foo), end(foo), ostream_iterator<string>{cout, " "});
}

Posting Principle
Dec 10, 2011

by Ralp

Shaggar posted:

that's not valid code

according to a microsoft architect it is

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

holy poo poo

bad programmer (me) expose time

C++ standard requires compile time constants for all arrays wow this is embarassing gently caress u g++ for misleading me for years

fortunately c++ is a bit more lenient about what it considers a constant expression

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

c++14 has VLAs and std::dynarray as a wrapper around VLAs but implementations don't have to allocate them on the stack

must be cool not knowing whether your vla has been declared on the heap or not

C++14 is bad

C++14 has make_unique, std::optional, and generic lambdas

my body is ready

Posting Principle
Dec 10, 2011

by Ralp
there is a project here that quietly includes -ftemplate-depth=4000

they gave up on build times a long time ago

Posting Principle
Dec 10, 2011

by Ralp
boost is gr8

Posting Principle
Dec 10, 2011

by Ralp

Symbolic Butt posted:

Python code:
a = [i.__add__ for i in xrange(5)]
I would've done this :smug:

No, I can't explain why lambda is such a piece of poo poo in python other than mumbling "lexical scope and closure or something". My rule of thumb is that if I want to do something fancy like I would in racket it'll go wrong in python.

as usual, c++ is expressive enough to let you define just the closure you need

C++ code:
    vector<function<int(int)>> a;
    for (int i = 0; i < 5; ++i) {
        a.emplace_back([i](int x) {return i + x;});
    }
    for (auto&& func : a) {
        cout << func(1) << endl;
    }
thank you bjarne

Posting Principle
Dec 10, 2011

by Ralp

PleasingFungus posted:

eh, it's pretty idiomatic. grab an iterator, map a single function on it, feed that into a set and then into a list. it's admittedly borderline - one more operation, and I'd definitely want to split it onto multiple lines - but I think it's ok.

actually, on further consideration, this is probably about right:

Python code:
def getValueList(flag, field):
    valueSet = set(row.getValue(field) for row in arcpy.SearchCursor(flag))
    return list(valueSet)

can you just use a set comprehension on that first line?

Posting Principle
Dec 10, 2011

by Ralp

PleasingFungus posted:

yes, I literally did two posts up from the one you quoted. but then I decided that it was too many things going on in one line, and split it up to make it easier to read.


no, calling set() on a list comprehension is not a set comprehension

Posting Principle
Dec 10, 2011

by Ralp

tef posted:

(ps technically he called it on a generator comprehension).


why am i so loving bad at python :eng99:

anyways, i'm sure you will explain why, but the set comprehension is reliably faster on my machine given these fake functions

Python code:
#alist is 1000 random ints generated before hand
def foo_set():
	return list(set(x**2 for x in alist)) 

def foo_comp():
	return list({x**2 for x in alist})
code:
>>> cProfile.run('for i in range(100000): foo_set()')
         100200003 function calls in 59.634 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   100000   13.401    0.000   59.078    0.001 <stdin>:1(foo_set)
100100000   45.677    0.000   45.677    0.000 <stdin>:2(<genexpr>)
        1    0.556    0.556   59.634   59.634 <string>:1(<module>)
        1    0.000    0.000   59.634   59.634 {built-in method exec}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Prof
iler' objects}


>>> cProfile.run('for i in range(100000): foo_comp()')
         200003 function calls in 46.887 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   100000    1.720    0.000   46.340    0.000 <stdin>:1(foo_comp)
   100000   44.620    0.000   44.620    0.000 <stdin>:2(<setcomp>)
        1    0.547    0.547   46.887   46.887 <string>:1(<module>)
        1    0.000    0.000   46.887   46.887 {built-in method exec}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Prof
iler' objects}

Posting Principle
Dec 10, 2011

by Ralp
i'm gonna write some python and dig into python source cuz im just embarassing myself

Posting Principle
Dec 10, 2011

by Ralp

PleasingFungus posted:

you got that backwards, the set comprehension is orders of magnitude slower per your numbers

gently caress if I know why, though

foo_comp uses the set comprehension, foo_set uses the set() builtin. they both ran 100k times and foo_comp took 13 seconds less??

Posting Principle
Dec 10, 2011

by Ralp
use ruby and make the front page of hn

Posting Principle
Dec 10, 2011

by Ralp
we're hiring full-stack engineers to help disrupt big suicide

Adbot
ADBOT LOVES YOU

Posting Principle
Dec 10, 2011

by Ralp
come build beautiful suicides with death.ly

  • Locked thread