« first day (1969 days earlier)      last day (2962 days later) » 

12:11 AM
ok , no problem :) my exemple is using windows Toast Notification on Desktop app(Wpf)
 
12:26 AM
ok :D
 
 
6 hours later…
6:44 AM
Good morning all
 
`morning, @scheien.
 
7:03 AM
morning @AvnerShahar-Kashtan, how's the monday morning treating you?
 
GOOD MORNING VIETNAM FELLOW C-Sharpers!
 
Good morning Mr. Winkler! Have you had your first coffee yet?
 
@scheien I drank coffee once, it was awful. I consume Fritz Kola for my coffeein intake.
and yes I had my intake already :)
 
Good to know!
:)
Deadline on friday, customer hasn't responded to my email last monday, or the reminder I sent wednesday. That will be.. fun fun fun.
 
7:24 AM
@scheien this may sound revolutionary but...maybe use a telephone? ;)
meanwhile I'm playing around with my new toy, postsharp :)
 
@scheien A bit violently. Not much sleep lately.
 
Good morning!
 
7:47 AM
morn
1
A: Object creation in C# inheritance hierarchy

Martin MaatThe answers given are all as abstract as what you learned from the books and I feel you want to know what it looks like under the covers. You can think of the child instance as a piece of memory that is exactly what you would get if you would instantiate a parent object, only with some extra bits...

is it actually correct?
 
@CrazyNinja It might be correct in a current implementation, but I don't think it's guaranteed to be correct. I don't know if the C# spec ensures that a derived class's memory signature will always be a strict superset appended to the end of all base classes.
It might be true in C++, but in C# I'm pretty sure it's an implementation detail that's left up to the CLR to decide.
 
@AvnerShahar-Kashtan yesterday my C# lecturer raised this question to me to find out
 
8
Q: CLR class memory layout

user1149224What is the memory layout of a CLR class? Coming from a C++ background, the memory layout of a C++ class with virtual functions starts with a v-table pointer, and then the data members of the class follow in memory. Do CLR classes with virtual functions have a v-table pointer? Is this pointer t...

 
for the SO question what i have posted, everyone answered that there will be a single object being created which includes all inherited features into it
 
Unless one of the answerers is Eric Lippert they probably don't actually know that
 
7:52 AM
@TomW Well, maybe John Skeet, in the question I've linked to.
 
Or Anders Hejlsberg posts sometimes I think
 
only jon has answered it :D
 
naturally
 
@SteffenWinkler Sure. I've tried :)
 
@AvnerShahar-Kashtan BTW: his link is too old and is not available there :(
 
7:54 AM
He cites a source anyway
Ok, I'll take that as authoritative XD
 
calling the base class's constructor means, that you create an object in the heap?
 
This might help too. I know the author, and he's a very authoritative source on .NET internals. blogs.microsoft.co.il/sasha/2012/03/15/…
@CrazyNinja Calling a base class's constructor doesn't actually create a base class. It just means that the derived class's construction phase includes several separate method calls, but there's still just one object constructed.
 
@AvnerShahar-Kashtan okay. it's like the Java way
@AvnerShahar-Kashtan but then, why does this gave me the same value?
Console.WriteLine("child object hashcode : "+this.GetHashCode());
Console.WriteLine("base object hashcode : "+base.GetHashCode());
 
@CrazyNinja Do you have different implementions of GetHashCode defined?
 
nope
 
7:59 AM
If you haven't overridden it, then both the child and base use the same implementation (defined in System.Object), which returns a value based on the instance. The instance is the same, so the hashcode is the same.
 
but i put that Console.writeLine in the base class's constructor
that means, before finish executing the derived class's constructor
but still got the same value
 
@CrazyNinja There are two steps to object construction. The first is allocation of the required memory, then the constructors are called. When the constructors run, the object already exists in memory.
 
I mean, at that point (Execution of the base constructor) has no instance created. According to everyone's answers to my SO question. except one fellow
 
Otherwise you wouldn't be able to use this at all in ctors (for instance, to pass a reference to a contained class).
 
@AvnerShahar-Kashtan i didn't know it for sure. Now I know it
 
8:03 AM
hi.
 
Step 1: Take the class's signature (including method table, implemented interfaces, inherited members, etc) and use these as a template to create the instance, which is the memory layout of the object.
Step 2: Run the constructor logic, which is user-defined code *in addition* to the memory allocation.
 
hello every one.
please help me .i have a problem with iis 7 in windows 2008
 
In C and C++, you can override malloc or new and create your own object memory allocators, but in C# the allocation is done by the CLR before your code runs - before your code can run, because in order for the ctor to run, its code has to be loaded into memory, meaning your class's code is loaded into memory, meaning your instance has been created.
 
@AvnerShahar-Kashtan Step 1.5 : Initialize the static members and run the static constructors (if there are any; but ONLY ONCE)
 
Morning brothers and sisters
 
8:04 AM
@CrazyNinja I think it's step 0.5, but I'm not sure of the specifics.
 
I would assume that statics are entirely removed from the instances, surely?
 
@AvnerShahar-Kashtan This is the place which my lecturer asked me to do a little research. let me explain the scenario
@AvnerShahar-Kashtan dotnetfiddle.net/JtyAat
 
These are the sort of interview questions I've asked before, though I've mostly stopped with them.
 
My lecturer is asking me, you I create SavingsAccount and CurrentAccount objects, I am just wasting memory in the heap. Cos I will anyway allocate memory for my Account object that is created through the inheritance
 
It's nice if a candidate knows the ins and outs of C# inheritance, but not knowing the intricacies by heart doesn't disqualify.
This isn't even a micro-optimization, it's a nano-optimization.
 
8:09 AM
@AvnerShahar-Kashtan seriously?
 
The memory footprint of a SavingAccount includes two fields (the inherited accountHolder and the local savingsAccountNo), two ctors (inherited and local) and a method.
 
@AvnerShahar-Kashtan Is there anyway that I can avoid allocating memory for the base object, if it is already available in the heap?
 
Good morning.
 
Unless you're writing a CLR implementation, it really isn't up to you. The CLR probably optimizes your SavingsAccount and CurrentAccount vtables with a pointer to the already defined method to only have it once, but it's really not something a developer should care about.
 
@AvnerShahar-Kashtan is there any way that I can forcefully say in any of my constrcutors?
 
8:13 AM
Lines 41/42 are meaningless. If you instantiate SavingsAccount, there is no Account instance. There's only a SavingsAccount instance, whose template is comprised of its base classes + local code.
 
@AvnerShahar-Kashtan Ok. good point. If that so, how can I see that this is really happening or not. I mean, how can i observe it?
 
Wow, really, your lecturer is bitching about "wasting memory" like this?
 
@RoelvanUden I think the lecturer believes that derived classes create an instance of their base classes and delegate calls to base classes to that internal instance.
 
Then he's not very well informed. :P
 
@AvnerShahar-Kashtan EXACTLY!
 
8:15 AM
@CrazyNinja Well, that's just not the case.
A derived class is a superset of the base class, but exists independently.
 
It's only going to fill the vtable and use the register (ecx probably) to reference the instance containing the fields.
 
That's exactly the different between inheritance and composition.
 
@AvnerShahar-Kashtan yeah. I understand it
 
Oh wait you said that.
 
@RoelvanUden so, in this situation, developer has no control over this?
 
8:17 AM
No, it's the compiler and run-time deciding that.
Nor should you care
 
I don't care. But this has given as a research. So, i'm just bit curious is this really possible or not. :)
 
Sure. Download the .NET compiler source code, tweak it, and do as you please.
 
@RoelvanUden can't i take control over the v-table even through reflection ?
 
No, it's a lower level construct.
 
@RoelvanUden if you don't mind, just post your answer here > stackoverflow.com/q/35828609/4506140
 
8:23 AM
No. There is tons of documentation around, I don't care enough to bother reading it for you.
 
@AvnerShahar-Kashtan @RoelvanUden thanks for your comments.
conclusion : There will be only one object created at runtime. If the parent object is already available, the v-table is smart enough to point to them without allocating the memory for the those same attributes in the base.
 
"Parent object is already available"? No, there is no parent object.
FWIW there aren't even "objects" to speak of.
 
@RoelvanUden opps!. my bad. yes
 
An "object" is nothing more than a block of memory of specified size. And the "class methods" are nothing more than a bunch of code that does something, and so happens to store things in a block of memory referenced by a register it so happens to have.
 
If two different derived classes are instantiated, I believe the CLR will optimize and only load the code of shared base-class methods once, yes.
I'm not sure, though.
 
8:27 AM
Class methods aren't even aware ;-)
 
yes. methods anyway will be something static.
if I have 1000 child objects, and in my base object class method will be kept in one place and will be served for all 1000 child objects whenever they need them
am i correct?
 
Sure, the this is just a reference to a block of memory where the block of code stores its things.
Even if you have a million blocks of memory (objects), you'll still only have one block of code (method) to do that thing.
 
Does anyone know about a textview with clickable lines in windows forms?
I want a feedback from the line i clicked.
 
Morning all
 
Like the feedback you can get from a chckedListbox
 
8:46 AM
@n.Stenvang yeah
why not use a listbox?
 
I was just about to say that it is me being stupid...
I just realized that it was a listbox I was looking for...
 
:D
quack.
 
9:01 AM
@RoelvanUden I'm hosting my website (including an API for iOS/Android app) now at Versio.nl, do you have any advice for me regarding a good (better) hosting company in The Netherlands? It's often slow or services like HTTP or FTP are down for several reasons.
 
We have a core class in our system - "DomainEntity", that has a core property - "Type". This is stored as a string, an untyped string, rather than an enum. Partly for future compatibility (adding new types can be a system-wide change or a per-client customization) and partly for interacting with external systems (databases, configuration files, document index storage) where storing an enum key might not be preferable. This might not be ideal or how I would have designed it, but that's life.
 
@ErwinOkken I've only had good experiences with versio, but don't rely too much on shared hosting. VPS is where reliability is
 
Now, we have a lot of places where we compare to the Type field. I want different handling for different types. The problem is that the string, being a string, is case sensitive.
 
enums are magic too
 
So I have to use the Javasesque myEntity.Type.Equals(NodeTypes.Address, StringComparison.CurrentCultureIgnoreCase) everywhere, instead of the much clearer ==.
 
9:03 AM
@RoelvanUden Okay thanks, will discuss it :)
 
What would be the best way to remove this ugly wart of an equality statement that's in use everywhere?
 
@ErwinOkken Otherwise you'll always have the same issues. Or just move to a manged Azure or something. Truly, no Dutch company pulls off reliability like Amazon/Azure do (for obvious reasons) but especially so for shared hosting. VPS is guaranteed resources, shared is not.
 
It's even worse for our entity's identifiers, which are also strings, and also case insensitive - an indentifier could be a hostname or username, which are logically case insensitive, but stored as case-sensitive strings.
 
@RoelvanUden How about DDOS and VPS? Does a VPS have his own IP-address?
 
One way, I suppose, is not to store them as strings, but create a new type (EntityType and EntityIdentifier) with implicit casting operators to and from strings (so that existing code won't break), but with an overridden == operator that does case insensitive checking.
 
9:07 AM
@ErwinOkken Yes, it has its own IP address. The ones at Versio are DDOS protected. Not all VPSes are.
 
@AvnerShahar-Kashtan yeah. But still if future compatibility is the purpose of the string, than EntityType can still be incompatible with a future parser, whos job is to convert code to a new era programming language. Like problems with convert VB6 code to C# code.
 
@ntohl Not sure I understand what you're saying.
The purpose of storing as string is that if a client decides that he has several custom types, the core system doesn't care, and simply stores that new type (as generated by the entity modeling subsystem).
Most places in the system don't care about types. Many places around the edges and in the UI do.
 
@RoelvanUden I have had so much negative things @ Versio, but I don't have enough experience to judge if they can actually do something about it. Not receiving any DDOS attacks is step 1. You familiar with the VPS or Versio or not?
 
@ErwinOkken Sure, I've ran my VPSs there for the last 5 years or so. Before it became "Cloud Box" even.
 
@AvnerShahar-Kashtan I would also override ==, and Your solution is good for that. If the "future compatibility" is for handle types dynamically, than it's good.
 
9:14 AM
@RoelvanUden Will it be straight forward or do I need to put a lot of effort in it to get things done? And maintining the state of the server is the most important one. I know how to host stuff but I'm not into security etc. All my project weren't really important but this one really needs reliability and security
 
I've observed that the first time I click an item in my listview the listview_SelectedIndexChanged is called once but when I click another item it is called twice?
Anyone know why it does this?
 
@ErwinOkken If you don't know about Linux, this means learning about setting up a Linux box without automatic security upgrades, yeah (spoiler: it's easy). If you don't want to do, get a managed site somewhere else. Don't go for Dutch providers, really, they're awful. Just like German etc. The only good ones are Amazon/Azure etc.
 
@RoelvanUden I'm thinking about "buying" Windows so I will also be able to play with ASP.NET for a change. Hot or not? :P
 
@n.Stenvang first one have items in the removing list, second one have items in the adding list I guess
 
@ErwinOkken Azure is a really nice host for that. I don't know any good European one for Windows.
 
9:20 AM
@RoelvanUden Thanks a lot for sharing your knowledge. I'm going to decide it today. We have a deadline incoming and my Versio shared hosting has had DDOS attacks at crucial moments so
 
@ntohl That would make sense. Do you know why my first column is the only clickable column?
 
@n.Stenvang I don't know, but I would use gridview, not listview, if more than 1 column is used. Is it WPF?
 
@ntohl What is the benefit of using a gridview? It is windows forms
 
2
Q: What is the difference between ListView and GridView in WPF?

JonasI am trying to create a WPF database application. There seems to be a few good components that I can use for showing the data in the database tables. ListView and GridView seems to be popular for this usage. But for a novice, it's hard to see the difference between them. What is the difference b...

 
Morning lads
 
9:35 AM
hi
 
Todays lecture : Constructor method
AND someone broke his toe
first lecture of toda hahahaha
 
9:55 AM
@MaartenWachters var brokenToe = new Injury(fool.Feet.Left.Toes.Big, InjuryType.Accident);
 
nice
 
@RoelvanUden Any advice on which Linux distribution would be best?
 
ooo my RasPi will be ready to collect "the day after tomorrow at 13:10h". This accuracy pleases me.
 
Are there any good alternatives to MapForce for mapping?
 
can I keep height and width on angular <div ui-view ??
atm when I change a view it loses my height and width
 
10:08 AM
can I use roslyn to create a code inspection for the +(string left, string right) operator where both left and right are literals?
code like this annoys me
var s = "long line 1"
+ "long line 2"
 
@Mathematics not really, unless you specify the dimensions explicitly in CSS.
@Mathematics angular just manipulates the DOM. It has no bearing on the style.
var s = string.Format("{0}-{1}-" +
"{2}",
a, a2,
_c)
;
 
Question: Azure websites for site hosting vs Traditional hostings? Which one to chose and when? What are your preferences?
 
@Squiggle Noice.
@ErwinOkken I like Ubuntu / Kali but if you're good at CLI / Commandlines I'd go for Debian or Arch
 
@Rusty What sort of app are you wanting to host? Is it containerable?
 
rusty - scaling purposes azure
 
10:15 AM
containerable? umm database access apps
 
Also you get more control over networking
as in traffic managers
and it has all this regional copies of all your stuff
 
i dont want to configure the crap of the server, just defaults stuff and all
What about price?
 
I got msdn subscription
so I get 150$ a month for free
for 5 years
 
Azure also has shared websites option now
That should be cost effective right
 
@Rusty seeing as you're asking this question, I'd stick with a traditional VM host. Will your app need to scale?
 
10:17 AM
(I meant bizspark, not msdn)
well the shared websites are slow as fuck
 
I dont think there will be a lot of traffic
 
they load awfully
 
@misha130 why do you think that is? What was your experience?
 
@Squiggle nopes, I dont think they will need to scale
 
It turns off the container I guess and then when someone access it, it turns it back on
 
10:19 AM
@misha130 i see
 
so the first person to enter gets to wait 20 seconds
 
@misha130 That sounds like default IIS behavior.
 
the not shared tiers have an auto ping option that keep it on forever
 
there is keeping site live option, Is special subscription required for this?
 
let me check to be sure
 
10:20 AM
azure makes a call to site to keep it avaiable
 
mind you I do mean web apps and not vm shared
(still checking)
 
yeap
 
basically get rekt
 
dammit :D
no love
 
well theres traditional hosting for 5$/m
 
10:24 AM
i think thats a better option for me. Small and basic apps
 
@ErwinOkken I only use Debian for servers.
 
Me.DB.ExecuteNonQuery("ss_UpdateOrderLineFromORderLineText")

Why are people so lazy that they don't change the name of a stored procedure with a minor typo like that before adding it in code? :P I just don't get it
Not like it matters.. It just looks bad
 
@JakobMillah eh, I'm forever fixing careless typos in our codebase. There are two solutions: Code reviews or aversion therapy.
 
ha!
 
haha
 
10:28 AM
!!wiki Ludovico technique
 
The Ludovico technique is a fictional aversion therapy from the novel A Clockwork Orange administered by a "Dr. Brodsky" at the Ludovico medical facility, with the approval of the UK Minister of the Interior. It involved forcing a patient to watch, through the use of specula to hold the eyes open, violent images for long periods, while under the effect of a nausea-, paralysis-, and fear-inducing drug. The aim of the therapy was to condition the patient to experience severe nausea when experiencing or even thinking about violence, thus creating an aversion to violent behaviour. The therapy renders...
 
@Squiggle I added a parent div and setting it in there
 
@Mathematics that's cool bro
 
I'm trying to make a full fleshed RPG in C#. Is it possible to use an image as a object?
 
@MaartenWachters please clarify question
 
10:35 AM
Right now my 'hero' and 'enemy' are just blue squares
I made some pixelart
Is it possible to use that as a 'square'
 
@MaartenWachters What graphics framework are you using?
 
Why not use Unity if you are on C#
 
@misha130 Uni project for extra grades :)
@AvnerShahar-Kashtan WPF
 
Make it Bauhaus style and stick to blue squares.
 
oh :^) well have fun
 
10:37 AM
@MaartenWachters Almost certainly not the best platform for RPGs, but sure you can do it. Your avatars are Rectangle instances?
You can either replace them with Images, or using an ImageBrush as the Rectangle's Fill property.
 
@AvnerShahar-Kashtan Just a method Public DrawRectangle { Rectangle r = new reactangle ....)
 
Animating my characters might be a little too difficult
I made pixel art of my professor programming and wanted to use it for the villain
 
what has art become
 
var heroBrush = new ImageBrush(new BitmapImage("path to PNG"));
var villainBrush = new ImageBrush(new BitmapImage("path to PNG"));
var heroIcon = new Rectangle { Fill = heroBrush};
 
10:40 AM
that piece of shit
 
hey thats pretty good
 
@misha130 Bauhaus is old art. These days it's all about the new aesthetic. Pixel art and digital glitch etc.
 
I just feel kind of weird calling this ballett
 
11:02 AM
@CrazyNinja You pinged me master?
 
I've had it with all these "unit" tests without any assertions
what's the matter with people?
 
@misha130 isnt Bizspark 3 years program?
 
goddamit, iforgot again
 
2-3 years IIRC. It was really useful for my previous company.
 
nvarhar or varchar?
 
11:10 AM
@Rusty for what?
 
generally, for database
 
nvarchar = unicode
varchar = ascii
 
@Ggalla1779 5 years
 
@Rusty When in doubt, use nvarchar - especially when storing user input etc.
 
right. Thank you :)
 
11:13 AM
@Ggalla1779 3 years you are right, 5 year old startups are qualified
 
Heh. Living outside of the English speaking world, varchar is simply a non-starter.
 
I just assumed its until startup is 5 years old
 
varchar is good for storing 'basic' text like identifiers, codes etc, but if might be storing characters with diacritics you're gonna have a bad time.
 
There really isn't any justification for storing ASCII Text anymore. UTF-8 is ASCII Compatible and doesn't make the assumptions that all your users and data are plain English speakers.
 
yeah I meant to say UTF-8
 
11:15 AM
"Oh, my user identifiers will always be basic Latin text" is a classic assumption to make that will find you, several months or years down the line with massive amounts of data that has to be painfully migrated into a Unicode-compatible solution.
 
looking at my database documentation
I just dont understand the difference between any and all for languages
 
@misha130 UTF-8, as a representation of Unicode, can store all different unicode characters. Meaning that the same text can have Latin, Hebrew, Arabic and Chinese characters side by side.
ASCII is a limited codeset that can only display a limited number of characters. As such, it has a mechanism called codepages that specify, for a given ascii-encoded string, which characters are encoded in it.
 
oh oh
 
can I add code below ng-app ?

e.g.


<div ng-app="app">
{{viewTitle}}
</div>


can I change viewTitle in controller ?
 
So the same binary represenation of a character can mean different things dependening on the CP used.
That means an ASCII column can represent any language, but not all languages at the same time.
 
11:23 AM
got it thanks
 
Encoding is hard.
 
totally
 
you live and learn :)
 
11:38 AM
I only just fixed a bug in our password hashing algorithm
 
plaintext passwords :))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 
it tried to convert plain text to byte arrays by using Convert.ToByte on every character
 
Legacy systems are literally my worst nightmare lol
 
everything we have is legacy
there's no more new developments in this team
 
@StevenLiekens Really, the fact that you have a password hashing algorithm of your own is the problem.
 
11:40 AM
you don't want to know how much business is paying to keep the existing systems alive
yeah lol
 
Legacy means "we wrote it last month, now live with it".
 
it's not exactly a hashing algorithm
 
it's a piece of software that makes a total hash of things?
 
it's just a small utility that converts a string to a byte array, runs it through SHA256Managed and returns the hash as a string of hexidecimal characters
don't ask me why they convert the output to a string instead of storing it as binary
but the real problem was how they went about converting the plain text password to bytes instead of using UTF8Encoding.GetBytes(string)
var bytes = new byte[plainTextPassword.Length];
for (var i = 0; i < bytes.Length; i++) bytes[i] = Convert.ToByte(plainTextPassword[i]);
 
my word
 
11:51 AM
we found out after chinese customers complained about not being able to log in
by "we" I mean "I"
 
Hi everyone
can some help with me Eval values from db ? and decode it via html decode method ? my apologies if i have spoiled the chat here :)
 
@gdoron i had a confusion over a basic question. Anyway, I got the answers from the others. :)
 
<%=System.Web.HttpUtility.HtmlDecode("can i pass my eval here")%>
 
12:09 PM
good morning, another monday morning without breakfast, please provide me a reason to not commit suicide
 
why are you not eating breakfast you
You will die!
 
woke up late, and bagels running out in office
 
kurwa
That's what I would tell to my boss if I were you
Just open the door to his office and yell KURWA and shut it again
That will make you feel much better
 
even i tell my boss, bagel will only come tomorrow
 
Then tell him, no bagels, no energy, no work
 
12:14 PM
the big bagel strike of 2016
 
!!pizza 400 301
 
@Squiggle Input not matching /(\d+)\s(\d+)/. Help: User-taught command: 'gives <>http://lorempizza.com/$1/$2#.png
 
stahp you donald trump
this is torture!
 
@tweray go get yourself some breakfast, man.
 
!!pizza 400 301
 
was playing Pathfinder yesterday and I made a huge dish of chili beef nachos. They were awesome.
bbl. Lunch.
 
You guys should try a "Swedish" kebab pizza.. I have actually not tasted a pizza outside of Sweden that is all that great tbh
 
;y=ー( ゚д゚)・∵.
 
12:32 PM
hello
 
tables in the db...

product
productcategory
productproduct
productproductcategory... Kill me
 
I have helper functions which are static inside a static class. For unit testing it is always good to avoid static functions.
My functions are like Round(float, int)
RandomRange(3, 10)
Should I make my class non static and instantiate it each time I need a helper function just so I keep it testable? :)
 
i don't see any problem to make things like that static
 
me neither
they may live in the test proj
 
and btw, there is a Math.Round there so it's basically wrapping a oneliner into another oneliner
 
12:36 PM
Yes I found Math.Round with digits as well but it uses double. I need to pass float parameter.
So I though why bother with converting float to double, let make a function
public static float Round(float value, int digits)
{
float mult = Mathf.Pow(10.0f, (float)digits);
return Mathf.Round(value * mult) / mult;
}
yes Mathf is from unity3D API
 
why not simply Math.Round((double) myFloat, digits) ?
 
user5671675
Hi, I have a quesions about ReSharper. Is it worth buying? Do u use it often at work ? At free trial I've got used to it abit but I don't know if it's good idea to continue using it becouse employers would looks for someone how have higher coding skills.
 
user5671675
and visual studio has it's own intelisense
 
 
((float)numOfCorrect * 100) / (float)numOfTasks will this calculation lose precision if I remove the float casting ?
oo wait is there percent function in C#?
 
12:46 PM
@Vlad modulo?
there is
 
user5671675
Math percent?
 
yes Math percent p = (i * 100) / s
 
if you remove the float cast, you will be doing integer division and always get 0
but you only need to cast one of them to float.
 
s = sum of all elements, i is part of all elements, p is percent
Isn't modulo(%) for getting reminder of division?
 
user5671675
Why resharper asking me to use Float.Parse() method instead of (float) casting ? Is it that important ?;)
 
12:51 PM
this gives error:
Math.Round((double)(((float)numOfCorrect * 100) / numOfTasks), Helper.PRECISION)
Cannot implicitly convert double to float
Or I use System.Convert.ToDouble()?
no still gives' the same error
 
Anyone here got any experience setting up runbooks in Azure?
 
webjobs?
 
I guess
Trying to set up a workflow script to start and stop VMs but it's proving to be extremely complicated, as is microsoft.
 
Nope, different things
 
@Vlad You have to convert numOfTasks to float if You want it that way
 
12:57 PM
Ok
still gives error:
float percent = ((float)numOfCorrect * 100) / (float)numOfTasks;
winPercent = Math.Round(System.Convert.ToDouble(percent), Helper.PRECISION);
 
double to float is explicit conversion. float to double is implicit. Isn't it?
what happens, if You try winPercent = Math.Round(percent, Helper.PRECISION);?
 

« first day (1969 days earlier)      last day (2962 days later) »