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
DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Papes posted:

https://www.youtube.com/playlist?list=PLz4D9vMpmI4I_GwnBUAxP9T-pCPDVL-Ko


So I realized that after I ran the script that I wasn't checking for duplicates, I dunno why that just never crossed my mind. There didn't appear to be an easy way to just remove all videos so I just kind of spot checked and removed as many dupes as I could be bothered to. It's me I'm the terrible programmer.

i knew u could do it

Adbot
ADBOT LOVES YOU

Brain Candy
May 18, 2006

gently caress them posted:

"Hey add this thing."

Ok.

[[Spaghetti intensifies]]

this is such a low bar that you should not feel smug or good about beating it

BONGHITZ
Jan 1, 1970

thanks for the playlist, will listen

BONGHITZ
Jan 1, 1970

i compile all my c++ scripts with -O2 i dont know how this works but it makes me feel really cool

gonadic io
Feb 16, 2011

>>=

BONGHITZ posted:

i compile all my c++ scripts with -O2 i dont know how this works but it makes me feel really cool

compilation takes longer as it spends more time reasoning about the code in order to produce faster code. afaik the only other downside to -O2 is that the code gets transformed lots more which can hurt debugging sometimes, but that's no biggie as you should just switch to -O0 when debugging. unless that stops the error from happening anymore in which case you're hosed!

Brain Candy
May 18, 2006

-Werror for best option

FamDav
Mar 29, 2008

AlsoD posted:

compilation takes longer as it spends more time reasoning about the code in order to produce faster code. afaik the only other downside to -O2 is that the code gets transformed lots more which can hurt debugging sometimes, but that's no biggie as you should just switch to -O0 when debugging. unless that stops the error from happening anymore in which case you're hosed!

at higher optimization levels you are likely to incur the wraith of unintended UB

Notorious b.s.d.
Jan 25, 2003

by Reene
gcc -Os is sometimes faster than -O2 or -O3

cache pressure is a bitch

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Notorious b.s.d. posted:

gcc -Os is sometimes faster than -O2 or -O3

cache pressure is a bitch

i always compile with -NOs

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

USSMICHELLEBACHMAN posted:

i always compile with -NOs

img-granny-clockin

Blinkz0rz
May 27, 2001

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

using reactiveui

how do i bind a selection in a listview to an observable property and trigger a reactivecommand?

BONGHITZ
Jan 1, 1970

FamDav posted:

at higher optimization levels you are likely to incur the wraith of unintended UB

unibomber?

double sulk
Jul 2, 2010

BONGHITZ posted:

unibomber?

Uncontrollable Bowels

distortion park
Apr 25, 2011


what's a good c++ book for someone who knows some java/c#? i looked in CoC but can't tell from the titles and the link doesn't work

Notorious b.s.d.
Jan 25, 2003

by Reene

pointsofdata posted:

what's a good c++ book for someone who knows some java/c#? i looked in CoC but can't tell from the titles and the link doesn't work

learn c first

distortion park
Apr 25, 2011



not really the answer i was hoping for

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

pointsofdata posted:

not really the answer i was hoping for
i read C++ Primer a few months back and found it p good. that it's called a "primer" while being 900 pages should tell you something about C++ as a language. id read C Programming previously, and while it was somewhat useful in providing context for the constructs C++ nails to C, i don't think it helped me all that much.

anyway whatever you pick make sure it was published in 2011 or later b/c C++11 made a whole pile of improvements that you don't wanna be without. C++14 added a few more but they're comparatively minor and you can pick them up by reading Effective Modern C++.

Brain Candy
May 18, 2006

pointsofdata posted:

not really the answer i was hoping for

if you've ever had to janitor resources and understand why you need to, you don't need to do that IMO

idiomatic c is awful c++, see goto error versus RAII

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
accelerated c++ is actually really good even if it doesn't tell you about the improvements in c++11

you can get the hang of the way iterator semantics work and how the STL algorithms work, those things haven't really changed

Luigi Thirty
Apr 30, 2006

Emergency confection port.

if (language == "c") { goto error; }

Nomnom Cookie
Aug 30, 2009



c++ has features that copy data automatically, and features to avoid automatically copying data. c++ programmers decide what mix of features to employ when writing a program and believe that this constitutes reasoning about performance

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Kevin Mitnick P.E. posted:

c++ has features that copy data automatically, and features to avoid automatically copying data. c++ programmers decide what mix of features to employ when writing a program and believe that this constitutes reasoning about performance
to keep the next guy's life interesting, write move constructors that return a subtly different object to the one returned by the copy constructor

Notorious b.s.d.
Jan 25, 2003

by Reene

Brain Candy posted:

if you've ever had to janitor resources and understand why you need to, you don't need to do that IMO

the only way you would ever had to "janitor resources" and understand the problems is to have used c/pascal/assembly in the past

i'm not gonna recommend someone learn pascal or assembly

Brain Candy posted:

idiomatic c is awful c++, see goto error versus RAII

yeah writing complex applications in c is a bitch. but you can learn c in a couple of weeks not years, and that foundation will help you every time you wonder "why is this so loving broken?"

distortion park
Apr 25, 2011


what's the minimum subset of c features which i need to know about in relation to other languages, memory management, pointers, and how types and functions work? I really can't see myself writing any actual c (or that much c++) in the future

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

pointsofdata posted:

what's the minimum subset of c features which i need to know about in relation to other languages, memory management, pointers, and how types and functions work? I really can't see myself writing any actual c (or that much c++) in the future

make sure you learn K&R brace style.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

i've spent half an hour trying to figure out how to set the source of a wpf image to a local file gently caress microsoft

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Luigi Thirty posted:

i've spent half an hour trying to figure out how to set the source of a wpf image to a local file gently caress microsoft
have you added it as a referenced resource + copied it to output

then it should be Source="dirname/filename.jpg"

Luigi Thirty
Apr 30, 2006

Emergency confection port.

coffeetable posted:

have you added it as a referenced resource + copied it to output

then it should be Source="dirname/filename.jpg"

yes that works in xaml, i'm trying to do it from the program

ok:
code:
        <Image x:Name="dealerCard1" HorizontalAlignment="Left" Height="145" Margin="10,10,0,0" VerticalAlignment="Top" Width="100" Source="/BlackjackGame;component/images/red_joker.png">
            <Image.Effect>
                <DropShadowEffect/>
            </Image.Effect>
        </Image>
unhelpful invokation exception that doesn't tell me anything:
code:
        public MainWindow()
        {
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();
            bi.UriSource = new Uri("/BlackjackGame;component/images/red_joker.png", UriKind.RelativeOrAbsolute);
            bi.EndInit();

            dealerCard1.Source = bi;

            InitializeComponent();

        }

Luigi Thirty fucked around with this message at 20:57 on Jul 27, 2014

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Luigi Thirty posted:

yes that works in xaml, i'm trying to do it from the program

ok:
code:
        <Image x:Name="dealerCard1" HorizontalAlignment="Left" Height="145" Margin="10,10,0,0" VerticalAlignment="Top" Width="100" Source="/BlackjackGame;component/images/red_joker.png">
            <Image.Effect>
                <DropShadowEffect/>
            </Image.Effect>
        </Image>
unhelpful invokation exception that doesn't tell me anything:
code:
        public MainWindow()
        {
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();
            bi.UriSource = new Uri("/BlackjackGame;component/images/red_joker.png", UriKind.RelativeOrAbsolute);
            bi.EndInit();

            dealerCard1.Source = bi;

            InitializeComponent();

        }

try System.Uri(@"X:\your\file\here")

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
but seriously embed it as a resource in your assembly

Luigi Thirty
Apr 30, 2006

Emergency confection port.

uhhh the problem was solved by putting InitializeComponent first

Brain Candy
May 18, 2006

Notorious b.s.d. posted:

the only way you would ever had to "janitor resources" and understand the problems is to have used c/pascal/assembly in the past

i'm not gonna recommend someone learn pascal or assembly

streams, sockets, connections, threads, threadpools are all things things you still have somewhat manage or at least treat differently than other things that get GC'd for you. or arenas or pools or things that if you know about them beyond voodoo you are good

unless you are writing a trivial/bad program, in which case, sure, you don't have to ever clean up memory either

quote:

yeah writing complex applications in c is a bitch. but you can learn c in a couple of weeks not years, and that foundation will help you every time you wonder "why is this so loving broken?"

if somebody asks about learning javascript i don't tell them to use c# unless i'm shaggar

edit: but it looks like pointsofdata doesn't actually want to learn either so

Brain Candy fucked around with this message at 21:18 on Jul 27, 2014

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Luigi Thirty posted:

uhhh the problem was solved by putting InitializeComponent first
yeah that method's in every WPF constructor bc it does the work of parsing the XAML part of the class

incidentally dont use codebehind unless you absolutely have to

Brain Candy
May 18, 2006

USSMICHELLEBACHMAN posted:

make sure you learn K&R brace style.

agreed, {}

Luigi Thirty
Apr 30, 2006

Emergency confection port.

coffeetable posted:

yeah that method's in every WPF constructor bc it does the work of parsing the XAML part of the class

incidentally dont use codebehind unless you absolutely have to

unless there's a way to make a text label update itself to the current value of deck.CardsRemaining()

Notorious b.s.d.
Jan 25, 2003

by Reene

pointsofdata posted:

what's the minimum subset of c features which i need to know about in relation to other languages, memory management, pointers, and how types and functions work? I really can't see myself writing any actual c (or that much c++) in the future

the terrible macro system (relevant to c++ templates)
c stack/heap distinctions
how dlls or shared objects work on your platform
whatever awful build system you will use (they're all bad)

Notorious b.s.d. fucked around with this message at 22:04 on Jul 27, 2014

Notorious b.s.d.
Jan 25, 2003

by Reene
learning c++ satisfactorily can take many years it's that big and that bad a language

i "know C++" but i have in no way mastered it, and i never will. that is on my whatever the inverse of a bucket list is.

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Notorious b.s.d. posted:

i "know C++" but i have in no way mastered it, and i never will. that is on my whatever the inverse of a bucket list is.

C++ Grandmaster Certification

Overview
Students of this two part online course each single-handedly develop their own original C++ compiler, standard library, and toolchain with the following features:
- Compliant with the latest 2011 standard (C++11)
- Written entirely in C++ with no third-party dependencies
- Code generator targeting Linux x86_64
- Full toolchain including preprocessor, compiler frontend/backend, assembler, linker and all standard library components
- Builds with itself (self-hosting) and passes provided conformance test suite


Isn't this a huge undertaking, usually done by an entire team of programmers?

Yes, earning the title Certified C++ Grandmaster is for most programmers the hardest programming exercise they have completed in their careers. It requires writing well over 100,000 lines of code, implementing about 2000 pages of dense technical specifications and takes over 1000 hours of intense work for that small percentage of world-class programmers that are ready to complete it at all.

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
world-class programmers: people prepared to burn ~1,000 hours re-implementing a thing

Adbot
ADBOT LOVES YOU

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Luigi Thirty posted:

unless there's a way to make a text label update itself to the current value of deck.CardsRemaining()
http://msdn.microsoft.com/en-us/library/ms743695(v=vs.110).aspx

e: or if you're using reactiveui just inherit from reactiveobject

coffeetable fucked around with this message at 22:20 on Jul 27, 2014

  • Locked thread