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
jesus WEP
Oct 17, 2004


i already gave you the answer

St Evan Echoes posted:

the book with the medieval mexian banjo hipster on the cover
its called c# in depth

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

hmm

web resources preferred but thats at least cheap

wonder if our library has it

lord of the files
Sep 4, 2012

ive followed these lessons in the past for the absolute basics: http://homeandlearn.co.uk/csharp/csharp.html

Jeffrey of YOSPOS
Dec 22, 2005

GET LOSE, YOU CAN'T COMPARE WITH MY POWERS

Bloody posted:

hmm

web resources preferred but thats at least cheap

wonder if our library has it
the first page of google for "c# in depth" has it so it must be free

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

lmao i have no idea what i'm doing

Jerry Bindle
May 16, 2003

Captain Foo posted:

lmao i have no idea what i'm doing

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!

Captain Foo posted:

lmao i have no idea what i'm doing

Blinkz0rz
May 27, 2001

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

Captain Foo posted:

lmao i have no idea what i'm doing

Bloody
Mar 3, 2013

Jeffrey of YOSPOS posted:

the first page of google for "c# in depth" has it so it must be free

lol

triple sulk
Sep 17, 2014



Captain Foo posted:

lmao i have no idea what i'm doing

Shaggar
Apr 26, 2006
jesus christ, don't use hibernate

MeruFM
Jul 27, 2010

Shaggar posted:

jesus christ, don't use hibernate

hql lol

Valeyard
Mar 30, 2012


Grimey Drawer

Shaggar posted:

jesus christ, don't use hibernate

i need to go with the flow, its already entrenched in the system

gabensraum
Sep 16, 2003


LOAD "NICE!",8,1
i've been using grails for a couple of years since changing jobs and mostly i like it but the single worst irredeemable thing about it is hibernate

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Nitrocat posted:

i personally use this lib to help me work with writeablebitmap , it's basically enhanced SetPixel methods among other things: http://writeablebitmapex.codeplex.com/

to help with your question and assuming no third party libs, is the BitMap bound as the source for the image? this is typically how I set it up:

code:

BitmapSource bitmapSRC = JpegBitmapDecoder.Create(File.Open("C:\users\nitro\testimage.png", FileMode.Open),  BitmapCreateOptions.None, BitmapCacheOption.OnLoad).Frames[0];
if(source.Format!=PixelFormats.Bgra32)
{
	bitmapSRC = new FormatConvertedBitmap(bitmapSRC , PixelFormats.Bgra32, null, 0);
}
var writeBitMap = new WriteableBitmap(bitmapSRC );

I know it's bound properly - I have a button that clears the WriteableBitmap to white when it starts as black, but doing WriteableBitmap.SetPixel(4, 4, Colors.White) or whatever (I'm at work) doesn't flip a black pixel to white on the window for some reason

JawnV6
Jul 4, 2004

So hot ...
hello windows my old friend
ive come to call onPaint() again

jesus WEP
Oct 17, 2004


OnPaint* :cmon:

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
the ironic confrontational posting style doesn't seem to work well outside of SA

not really blaming SA because it was usenet that made me the shitposter I am

gonadic io
Feb 16, 2011

>>=

Captain Foo posted:

lmao i have no idea what i'm doing

New thread title please

lord of the files
Sep 4, 2012

Luigi Thirty posted:

I know it's bound properly - I have a button that clears the WriteableBitmap to white when it starts as black, but doing WriteableBitmap.SetPixel(4, 4, Colors.White) or whatever (I'm at work) doesn't flip a black pixel to white on the window for some reason

are you locking the bitmap before writing to it and are you setting the image source again after setting the pixel? one thing you can do to make sure that the image gets updated is to set the source to the newly updated bitmap. if you are already doing locking then disregard the lock code. but try setting the image source to the WriteableBitmap after setting the pixels, even if you have previously already set it, and see what happens. not locking can prevent your image from updating, according to MSDN anyway.

code:
bitmapSRC.Lock();
//do pixel stuff
bitmapSRC.Unlock();

image.Source = WriteableBitmapInstance

lord of the files fucked around with this message at 00:28 on Nov 18, 2015

lord of the files
Sep 4, 2012

i am curious why hibernate should not be used. i have been using grails for a few years now, and I find gorm to be helpful with setting up my tables and managing connection pools. now i have run into issues with "group by" and "having" in hql, but other than that are you saying i should just be writing all my queries myself?

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
just got into an incredibly stupid discussion on facebook (!)

guy demonstrates floating point loss of precision with excel, subtracting 0.01 a hundred times from 1, result is not exactly zero. he's all insufferable nerd like "free ice cream to the first non-computer guy who can explain why in 10 words or less :smug:", finally "ends the contest" all disappointed with his fb friends, explaining floating point, how 1/10 can't be represented exactly in base 2, etc. and some incredible poo poo on how BCD is the only way to get an exact result. what the gently caress, right? I make an effortpost on rationals and fixed point and arbitrary precision, and he uh, just does not understand what rationals are. I mean he does in a purely theoretical way but it's clear he's never used them in software like ever. seems to confuse the textual representation of 1/3 (literally infinite) with the in-memory representation (literally a 1 followed by a 3 for a total of 3 bits before rounding/overhead). he immediately moves the goalposts to a matter of orders of magnitude, who the gently caress cares though? you want approximate results but more precision than a 64 bit IEEE float, you use arbitrary precision floating point, there are plenty of libraries, nobody forces you to use the hardware-provided floats. I specifically included arbitrary precision floating point and a disclaimer about space/time complexity because you're dealing with nerds, you rules-lawyer up. also did you know that to do exact calculations with numbers like 0.1 you need a symbolic mathematics engine??? literal argument made by him, the solution to the rounding issue besides BCD (!!!)

also smug about not using windows when I told him that the windows calculator can add and subtract 0.1, 0.01, etc. just fine (of loving course it uses rationals internally, except for irrationals which are stored as decimal fixed point with IIRC 64 decimal places), so I told him, try it with bc, in fact script it with bc and see if the result isn't 100% exact every single time, must be magic or some sci-fi-level symbolic calculator poo poo and not basically 9th grade arithmetic. but no it doesn't scale and can't calculate the fisher test for a large population in useful time so it must be some toy that's never used anywhere by anyone and not say a hugely popular software package old enough to drive, vote and drink

BCD, loving seriously? he's an old so it's somewhat excusable but does he really think the world never moved on from there?

vodkat
Jun 30, 2012



cannot legally be sold as vodka

hackbunny posted:

just got into an incredibly stupid discussion on facebook (!)

guy demonstrates floating point loss of precision with excel, subtracting 0.01 a hundred times from 1, result is not exactly zero. he's all insufferable nerd like "free ice cream to the first non-computer guy who can explain why in 10 words or less :smug:", finally "ends the contest" all disappointed with his fb friends, explaining floating point, how 1/10 can't be represented exactly in base 2, etc. and some incredible poo poo on how BCD is the only way to get an exact result. what the gently caress, right? I make an effortpost on rationals and fixed point and arbitrary precision, and he uh, just does not understand what rationals are. I mean he does in a purely theoretical way but it's clear he's never used them in software like ever. seems to confuse the textual representation of 1/3 (literally infinite) with the in-memory representation (literally a 1 followed by a 3 for a total of 3 bits before rounding/overhead). he immediately moves the goalposts to a matter of orders of magnitude, who the gently caress cares though? you want approximate results but more precision than a 64 bit IEEE float, you use arbitrary precision floating point, there are plenty of libraries, nobody forces you to use the hardware-provided floats. I specifically included arbitrary precision floating point and a disclaimer about space/time complexity because you're dealing with nerds, you rules-lawyer up. also did you know that to do exact calculations with numbers like 0.1 you need a symbolic mathematics engine??? literal argument made by him, the solution to the rounding issue besides BCD (!!!)

also smug about not using windows when I told him that the windows calculator can add and subtract 0.1, 0.01, etc. just fine (of loving course it uses rationals internally, except for irrationals which are stored as decimal fixed point with IIRC 64 decimal places), so I told him, try it with bc, in fact script it with bc and see if the result isn't 100% exact every single time, must be magic or some sci-fi-level symbolic calculator poo poo and not basically 9th grade arithmetic. but no it doesn't scale and can't calculate the fisher test for a large population in useful time so it must be some toy that's never used anywhere by anyone and not say a hugely popular software package old enough to drive, vote and drink

BCD, loving seriously? he's an old so it's somewhat excusable but does he really think the world never moved on from there?

Good rant :five:

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

hackbunny posted:

just got into an incredibly stupid discussion on facebook (!)

guy demonstrates floating point loss of precision with excel, subtracting 0.01 a hundred times from 1, result is not exactly zero. he's all insufferable nerd like "free ice cream to the first non-computer guy who can explain why in 10 words or less :smug:", finally "ends the contest" all disappointed with his fb friends, explaining floating point, how 1/10 can't be represented exactly in base 2, etc. and some incredible poo poo on how BCD is the only way to get an exact result. what the gently caress, right? I make an effortpost on rationals and fixed point and arbitrary precision, and he uh, just does not understand what rationals are. I mean he does in a purely theoretical way but it's clear he's never used them in software like ever. seems to confuse the textual representation of 1/3 (literally infinite) with the in-memory representation (literally a 1 followed by a 3 for a total of 3 bits before rounding/overhead). he immediately moves the goalposts to a matter of orders of magnitude, who the gently caress cares though? you want approximate results but more precision than a 64 bit IEEE float, you use arbitrary precision floating point, there are plenty of libraries, nobody forces you to use the hardware-provided floats. I specifically included arbitrary precision floating point and a disclaimer about space/time complexity because you're dealing with nerds, you rules-lawyer up. also did you know that to do exact calculations with numbers like 0.1 you need a symbolic mathematics engine??? literal argument made by him, the solution to the rounding issue besides BCD (!!!)

also smug about not using windows when I told him that the windows calculator can add and subtract 0.1, 0.01, etc. just fine (of loving course it uses rationals internally, except for irrationals which are stored as decimal fixed point with IIRC 64 decimal places), so I told him, try it with bc, in fact script it with bc and see if the result isn't 100% exact every single time, must be magic or some sci-fi-level symbolic calculator poo poo and not basically 9th grade arithmetic. but no it doesn't scale and can't calculate the fisher test for a large population in useful time so it must be some toy that's never used anywhere by anyone and not say a hugely popular software package old enough to drive, vote and drink

BCD, loving seriously? he's an old so it's somewhat excusable but does he really think the world never moved on from there?


vodkat posted:

Good rant :five:

Jerry Bindle
May 16, 2003
ask him if .999... == 1

Bloody
Mar 3, 2013

hackbunny posted:

just got into an incredibly stupid discussion on facebook (!)

guy demonstrates floating point loss of precision with excel, subtracting 0.01 a hundred times from 1, result is not exactly zero. he's all insufferable nerd like "free ice cream to the first non-computer guy who can explain why in 10 words or less :smug:", finally "ends the contest" all disappointed with his fb friends, explaining floating point, how 1/10 can't be represented exactly in base 2, etc. and some incredible poo poo on how BCD is the only way to get an exact result. what the gently caress, right? I make an effortpost on rationals and fixed point and arbitrary precision, and he uh, just does not understand what rationals are. I mean he does in a purely theoretical way but it's clear he's never used them in software like ever. seems to confuse the textual representation of 1/3 (literally infinite) with the in-memory representation (literally a 1 followed by a 3 for a total of 3 bits before rounding/overhead). he immediately moves the goalposts to a matter of orders of magnitude, who the gently caress cares though? you want approximate results but more precision than a 64 bit IEEE float, you use arbitrary precision floating point, there are plenty of libraries, nobody forces you to use the hardware-provided floats. I specifically included arbitrary precision floating point and a disclaimer about space/time complexity because you're dealing with nerds, you rules-lawyer up. also did you know that to do exact calculations with numbers like 0.1 you need a symbolic mathematics engine??? literal argument made by him, the solution to the rounding issue besides BCD (!!!)

also smug about not using windows when I told him that the windows calculator can add and subtract 0.1, 0.01, etc. just fine (of loving course it uses rationals internally, except for irrationals which are stored as decimal fixed point with IIRC 64 decimal places), so I told him, try it with bc, in fact script it with bc and see if the result isn't 100% exact every single time, must be magic or some sci-fi-level symbolic calculator poo poo and not basically 9th grade arithmetic. but no it doesn't scale and can't calculate the fisher test for a large population in useful time so it must be some toy that's never used anywhere by anyone and not say a hugely popular software package old enough to drive, vote and drink

BCD, loving seriously? he's an old so it's somewhat excusable but does he really think the world never moved on from there?

you could literally just use fixed point math

suffix
Jul 27, 2013

Wheeee!
doesn't bc actually use decimal representation, though? :shrug:

MrMoo
Sep 14, 2000

I read a lot about BCD and some chipset with a lot of math support for BCD but never seen it in use anywhere.

Just use integers and cents as the unit, not exactly rocket science here.

I do chuckle every time in finance land I see people using float and double for prices though. Many people really do not understand floating point at all.

The Leck
Feb 27, 2001

question for the other terrible programmers: how long does it take for you to get even mildly comfortable with the code and surrounding ecosystem at a new job? i started at one a few months back, and i'm not sure how much of this is impostor syndrome, how much is normal learning curve, and how much is total lack of documentation/tests

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
the point is you can choose at least in C and C++. you can use rationals, bignums, bigfloats, as large as you like, in base 256 or base 10, there are libraries for everything. I think GMP alone supports all those. there are libraries for more exotic representations. there are libraries to calculate all sorts of irrational functions to an arbitrary precision. there's not this immense gulf the guy is painting between IEEE floats and full-frontal symbolic math engines with nothing in the middle (save for mother-loving BCD)

JawnV6
Jul 4, 2004

So hot ...

MrMoo posted:

I read a lot about BCD and some chipset with a lot of math support for BCD but never seen it in use anywhere.

RTC libraries

MeruFM
Jul 27, 2010

The Leck posted:

question for the other terrible programmers: how long does it take for you to get even mildly comfortable with the code and surrounding ecosystem at a new job? i started at one a few months back, and i'm not sure how much of this is impostor syndrome, how much is normal learning curve, and how much is total lack of documentation/tests

It depends a lot on how much other people are willing to help you and if the codebase is organized in a structure that you're familiar with

Jerry Bindle
May 16, 2003
yeah and you can't know what something is supposed to do unless someone tells you. you might be able to make a good guess about what something is supposed to do based on tests or what it actually does, but thats like diggin up bones old and sayin "hmm this fool probably was a carpenter"

Jeffrey of YOSPOS
Dec 22, 2005

GET LOSE, YOU CAN'T COMPARE WITH MY POWERS
I'm glad that x86 has special instructions to, after adding two numbers, "clean up" the result as if those numbers had actually been BCD.

Shaggar
Apr 26, 2006

Nitrocat posted:

i am curious why hibernate should not be used. i have been using grails for a few years now, and I find gorm to be helpful with setting up my tables and managing connection pools. now i have run into issues with "group by" and "having" in hql, but other than that are you saying i should just be writing all my queries myself?

orms are bad. use statement mappers and stored procs instead.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

what the gently caress is going on!? when my program starts, I have a 32x32 image in the window that's bound to a property of the viewmodel which is null. i press a button and define the property as such

code:
<Image x:Name="imgTestCharacter" Source="{Binding Path=TestCharacter}" HorizontalAlignment="Left" Height="32" Margin="215,39,0,0" VerticalAlignment="Top" Width="32" Stretch="None"/>
code:
public WriteableBitmap CharacterImage;
 CharacterImage = new WriteableBitmap(32, 32, 96, 96, PixelFormats.BlackWhite, null);
CharacterImage.Lock();
CharacterImage.Clear(Colors.White);
CharacterImage.Unlock();
and then write it to the bound property. and the resulting image is 3/4 black and 1/4 white



i hate all uis

jony neuemonic
Nov 13, 2009

Shaggar posted:

orms are bad.

jony neuemonic
Nov 13, 2009

sql is a good dsl for working with data and using orms discourages you from learning and using it.

Bloody
Mar 3, 2013

jony neuemonic posted:

sql is a good dsl for working with data and using orms discourages you from learning and using it.

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

hackbunny posted:

just got into an incredibly stupid discussion on facebook (!)

guy demonstrates floating point loss of precision with excel, subtracting 0.01 a hundred times from 1, result is not exactly zero. he's all insufferable nerd like "free ice cream to the first non-computer guy who can explain why in 10 words or less :smug:",

like decimals, 1/3 = 0.33333...., representations of numbers have limits :toot:

but really there's too much going on here before you can get to that, "numbers have more than one representation within a number system", and then "different bases exist" and then "some numbers do not have short or even representations"

quote:

finally

did you get fishmeched on facebook

  • Locked thread