« first day (1718 days earlier)      last day (3233 days later) » 

11:02 AM
Well I have been trying to get it work but I'm really lost, I was thinking that doing it like I would do it in Java would be easier but I'm not sure about that yet. I could do it by making a method that takes reference to the field, then it makes the control and when controls value changes it would update the field value too.
 
I have no idea what you're trying to describe now. Can you post a SCCE please?
 
I wonder: is there an app that keeps track of links to check if they are still valid?
 
@FINDarkside Isn't that what databinding does for you?
 
@MoonOwlPrince What?
 
@MoonOwlPrince google
 
11:12 AM
@FINDarkside: Why can't you just use a property?
 
@FINDarkside Isn't that basically a property..?
 
ah. Java doesn't have properties iirc
Do you understand the difference?
 
@TomW: You are correct.
 
I have class Save which holds save data. One of those is achievements, achievements has many fields containing information, so I would acces it like save.achievements.someField. That data is later serialized to json. Saving and loading already works, but now I'm trying to make the GUI to edit these fields and I think that I'm doing something wrong, since doing the whole GUI programmatically (without binds) and updating the fields manually seems like easier way to me.
Here's some kind of structure of the data I would access from the GUI pastebin.com/CR0yBtFK
 
WPF won't bind to fields. Use properties.
I have to go.
 
11:17 AM
You have to use properties (public [Type] [Name] {get; set; } to use them in your GUI.
 
But I need to serialize those classes to json
 
You can serialize properties :)
 
You still can
 
Does it serialize them the same way as if they were fields?
 
Yes
 
11:18 AM
@TomW So that means no getters and setters? How do you validate data then? Do you write Get and Set methods for each field making them private?
 
@MoonOwlPrince: Yep, java have what they call accessor and mutator methods (essentially getters and setters).
    public void setName(string name) { this.name = name; }
 
@TomW Baby come back!
 
@MoonOwlPrince There are getters and setter, but they are just invidual methods that modify some field
 
@scheien Yuck
 
11:21 AM
@FINDarkside In C#, properties 'auto generates' those methods. msdn.microsoft.com/en-us/library/x9fsa0sw.aspx
 
@MoonOwlPrince: Terrible, I know.
 
I also heard Java does not have delegates
 
Java does not have a lot of things we find normal.
 
I'm glad I changed from java to c#
 
But C# is also ~13 years old! We should all jump ship to something new immediately!
 
11:23 AM
Like operator overloading
 
Let's all do Haskell!
 
Operator overloading saves API users time in the fofice
@RoelvanUden Go?
 
+ It's not so damn ugly, try to read java math with BigDecimal or BigInteger :D
 
@MoonOwlPrince I didn't like it. F# perhaps :P
 
One of my lecturers told me that Java generics are implemented using type erasure. He told me that even though the concept is beyond me at this point in time, it is the worst way anyone could implement generics
@RoelvanUden Sounds like a good deal
 
11:26 AM
Respect if you can do this
 
@MoonOwlPrince He is correct
 
!!wiki type erasure
 
In programming languages, type erasure refers to the compile-time process by which explicit type annotations are removed from a program, before it is executed at run-time. Operational semantics that do not require programs to be accompanied by types are called type-erasure semantics, to be contrasted with type-passing semantics. The possibility of giving type-erasure semantics is a kind of abstraction principle, ensuring that the run-time execution of a program does not depend on type information. The opposite of type erasure is called reification. == Reverse operation == The reverse operation...
 
@Loetn wooo
I don't remember what all the consequences of type erasure are, but I'm pretty sure I saw an example that added an object of the wrong type to a generic list
 
11:29 AM
Even if they were properties I still have problems binding those. I think that the actual question is that if I knew how to bind, how many lines would i need to Bind some control value to property, and the property would change when control value changes.
 
in Xaml: eg.: Text="{Binding Property}", and your datacontext set to your class that holds that property
c#: public string Property {get; set;}
Or public string Property
private string property;
public string Property
{
get
{
return this.property;
}
set
{
this.property = value;
this.OnPropertyChanged(); // From INotifyPropertyChanged
}
}
 
But how do I set the datacontext, I have made Save class objects static in the hope of it would make things easier
Yesh i know how to make property, but If I need input validation I just cant write the validation to the set method since I have so many properties
 
You can use IDataErrorInfo for validation
 
The way i was thinking would be like:
createBooleanControl(parent, description, property);
createBooleanControl would add checkbox to parent, and when its value changes it would update property
 
Are you creating your control in code behind?
 
11:37 AM
cries
WHY IS IE SO BROKEN
MICROSOFT Y U DO DIS
Y
 
Not necessarily, but that's the way I think I will get it working, but I'm wondering if that's not so smart way.
 
Can't you create your controls in XAML and bind that way?
 
Yes I can if I just could, like I said i'm new to C# and all binding tutorials have been a mess without comments in code.
 
@FINDarkside In the last 6 years, I can count the number of times I had to generate WPF controls in code on one hand. It's almost certainly the wrong way to approach this, whatever this is.
 
Yes I can make them with xaml too, but generating them in code would just seems easier at the moment. Most of the stuff will be there every time so there's no reason I couldn't make it with xaml
 
11:46 AM
Even dynamically generated controls should usually be created with repeating ItemsControls and DataTemplates.
It's one of the things that make WPF so much clearer than WinForms, despite its verbose and less-than-ideal syntax.
 
its funny that the google server I get pointed to is in the netherlands
I would have thought it would be one of the US server farms
 
Where do you live @JABFreeware?
 
Missouri
 
You'd expect that then yea
 
If it's really so simple, then how would I bind checkbox isChecked to Save.achievements.hasFiredGun? Save is obviously the class and achievement is static property and hasFiredGun is boolean property
 
11:51 AM
@RoelvanUden facebook points to a US server
 
Hi Guys , i got Coockie files from a system.net cockie container , anyone know how i can send it to a Web Browser control so it would load pages with the cockie ?
 
and so does gmail wtf
 
@JABFreeware Dutch Google server > US Google server confirmed
 
@Loetn what?
 
SJD
11:57 AM
One question: is possible to trigger a property of another control even the style property was binded to another element?
 
@SJD question unclear, rephrase?
 
Can you specify your question please?
 
Can someone help me with an issue with sockets? I have searched all over the web but I can't find anything that will helps me?
 
SJD
wel.. it is more about wpf stuff:)
 
@AshSimpson do tell
 
SJD
12:00 PM
I have a ComboBOx with values: Gross & NetMarket
also, I have a <WindowsFormsHost x:Name="Host" />
when Gross is selected -> show host
when NetMarket is selected -> hide host
 
@JABFreeware When I send a message from my client, to my server. The first time I sent the message it is just a load of black spaces? say I sent "hello" the message would come out as " " the first time, but works fine the second time and all after that?
 
SJD
actually I have a style (resource file where I bind the property to my combobox)
 
@AshSimpson What kind of sockets?
 
SJD
and via Trigger I want to set property for Host if it is hidden or not hidden:D
 
@AshSimpson hard to answer without seeing code
 
SJD
12:01 PM
is that possible?
 
@FINDarkside Binding to static properties is a bit more complicated.
 
@AvnerShahar-Kashtan they can be changed to non static
 
@SJD Check out Style Triggers. Give the WindowsFormHost a Style with a DataTrigger that binds to the value of the ComboBox and sets Visibility based on it.
 
@KendallFrey TCP
stream^
 
SJD
@AvnerShahar-Kashtan Golden. Tx
 
12:03 PM
@AshSimpson CODE?????????
 
SJD
@AvnerShahar-Kashtan thought there can be done reversed.
 
@JABFreeware I can send a code snipplet now
 
@FINDarkside In that case, and assuming the DataContext is set to the instance of the Save class, you'd do something like <CheckBox IsChecked="{Binding Save.achievements.hasFiredGun}"/>
 
Nooo, don't use Begin/End methods. Those are old. Use the task-based ones.
 
12:05 PM
Ignore the below code, I did that to block out writing ther first message

_messages++;

if (_messages < 2)
return;
@RoelvanUden any links to tutorials? never used them ebfore...
 
Is there someone who has already worked with SimpleMembership & MySQL?
 
@AvnerShahar-Kashtan really nice, could you also tell me how to set the datacontext correctly? Where do I store the instance of Save?
 
4
Q: C# async await usage with TcpClient

Philippe ParéI recently started using the new C#5.0 "async" and "await" keywords. I thought I got the twist but realized one thing that made me doubt. Here's how I was asynchronously receiving data from a remote TcpClient. Once I accept the connection I call this function : static async void ReadAsync(TcpCli...

The first result I get. Something like that.
 
@RoelvanUden thanks
 
Basically, TcpClient, MemoryStream, StreamReader/BinaryReader/whatever and ReadAsync functions
 
12:08 PM
gotcha
 
SJD
@AvnerShahar-Kashtan you mean to bind like : <DataTrigger Binding="{Binding ElementName=MyCombo}"></DataTrigger> right?
 
socket server in windows...the idea scares me.
 
:24182555 <DataTrigger Binding="{Binding ElementName=MyCombo, Path=SelectedValue}" Value="Gross">
   <Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
And add another Setter, outside the Trigger, setting the Visibility to False.
 
@JABFreeware have to noticed anything in my code that could cause this?
 
This will make it always False except when MyCombo's value is Gross.
 
SJD
12:09 PM
I see.. So there is no need of Property Trigger
got it :)
 
I can always just ignore the first message sent, and send a blank one at the start.
 
@FINDarkside Set your datacontext in the constructor of your window. this.DataContext = new Save();
 
@AshSimpson I'd look at the accepted answer in @RoelvanUden's post. Hes right
 
@Loetn Ugh. I hate putting things in Codebehind.
 
I'm looking as we speak
 
12:10 PM
If it's a simple 1:1 match between view and viewmodel, you can instantiate it in the Window's XAML.
 
speak? chat you mean?
 
<Window .....>
<Window.DataContext>
   <my:Save />
</Window.DataContext>
[...]
</Window>
 
@AvnerShahar-Kashtan Ok, but I'm used to do it this way with IOC.
 
yes haha
 
For class-level variables, is it really standard to use an underscore prefix for the identifier?
 
12:13 PM
@AvnerShahar-Kashtan If i do it like that, where is the instance of Save and how do I access it from the code?
 
SJD
Is it fine to Keep *.xaml.cs file for Resources file? as a best practice?
 
@AshSimpson im precisely annoying like that :D
 
haha
I have changed my code to @RoelvanUden's idea, but I am receiving an error when casting a socket to StateObject ?
 
@AshSimpson CODE???????
 
12:20 PM
what line is the error?
 
line 5 on that gist
 
@FINDarkside It creates an instance of Save and assigns it to the Window's DataContext property.
You can access is from codebehind as "this.DataContext".
And it will be the default binding context, so you can bind a checkbox to {Binding achievements.hasFiredGun} directly.
 
@AshSimpson That's not my idea. My idea is to stop using Begin/End pattern.
 
It still doesnt work, I have set datacontext in the constructor and <CheckBox Content="Has fired gun" IsChecked="{Binding Save.achievements.m_HasFiredGun}"/>
 
12:24 PM
Because it's filled with stupidity and is hard to reason about.
 
@FINDarkside Is m_HasFiredGun a field? You can't bind to fields. Only to properties.
 
@RoelvanUden I fear its not getting through ;)
 
m_ prefix sounds like the C++ era :D
@JABFreeware I guess so :P
 
@RoelvanUden C++ is still very much alive. But I never coulde use _ I mean... its a reach for that key
reach == timelost
 
12:26 PM
Everytime I see _ I could hammer someone's head
 
and you have to hold shift too :(
 
It's property, achievements is property too if that's even needed?
 
it could possibly take an extra whole second
 
I use _ prefix for private variables because it saves time reading and figuring out the access of a thing. And we read most of the time, not write it. You're wasting time not using a prefix. But m_ as in member varible from C++ is just meh.
 
I mean PascalCasing and camelCasing withoutAbbreviations is just easier and self-documenting
 
12:27 PM
Well actually it's object so i'm not sure if it's property or what, but it has getter and setter
 
@MoonOwlPrince agreed
 
fork() vs CreateProcess()?
 
@MoonOwlPrince I think it leads to a lot more confusion. Easier to spot _value vs Value, rather than value vs Value. For me, anyway.\
@FINDarkside Do you know Snoop? It's an invaluable tool that can show you the XAML structure and binding errors at runtime.
 
@RoelvanUden thats a valid point I guess. I have had trouble following some code without it. Maybe I should adopt that approach for private variables
 
Even without it, you can look at Visual Studio's Output pane to see Binding errors.
 
12:29 PM
@AvnerShahar-Kashtan You have a point. We don't want to end up using this to refer class-level variables
 
System.Windows.Data Error: 40 : BindingExpression path error: 'Save' property not found on 'object' ''Save' (HashCode=19742389)'. BindingExpression:Path=Save.achievements.m_HasFiredGun; DataItem='Save' (HashCode=19742389); target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1')
 
Is your DataContext the Save object? If so, you don't need to specify it - the DataContext is the one that has an achievements proprety.
 
one thing that is not acceptable is. This_is_a_variable_name
 
yeah, the T should be lowercase
 
@AvnerShahar-Kashtan Ah thanks! Now it works :)
 
12:33 PM
@KendallFrey NOOOOOOO
its the use of the underscore instead of camel casing
 
:)
problem?
 
@FINDarkside XAML syntax can be very confusing and verbose, but once you get used to it, the declarative semantics are, for me, so much clearer than WinForms' imperative synyax.
 
@KendallFrey Camel casing is superior to underscores in every way.
unless its a situation like @RoelvanUden pointing out, and then its only a prefix
 
edc
yup, underscore is hard to type, and it extends the var name a lot
 
@AvnerShahar-Kashtan Haha ok, I have not much experience about WinForms either, just Swing :p
 
12:36 PM
That depends on the keyboard layout I presume?
I don't have any trouble typing underscores.
 
@FINDarkside I have no idea how swing works. Do you declare your layout and elements, or write interminable lines of code creating each one and setting its properties?
 
I think if your variable name is THAT long, you have other problems: This_Stores_The_Return_Value_In_Cases_Where_Errors_Occurred
@scheien whats your keyboard layout?
 
this_class_level_variable_represents_the_number_of_points_the_player_has_lost_si‌​nce_joining_the_network
 
@JABFreeware: norwegian style
 
@MoonOwlPrince :/ find that programmer and kill him
 
12:38 PM
underscore right above right windows key.
 
You people dunno how good you have it :)
 
@scheien well duh of course its not problem for you then. Mine is above the 'P'
which means an awkward reach with my pinky...which translates to lost time.
 
There are people who have made override methods for some of the data access stuff in our CMS API, and rather than rename the method to what it actually does, they just added a number to the end of the existing method name.
I cry every. fucking. time.
 
@AvnerShahar-Kashtan Probablt like WinForms, like frame.add(new JButton());
 
@Sippy Thats terrible
 
12:40 PM
@JABFreeware Why not use the index(?) finger? or did you mean pinky on the shift key?
 
But there are layoutmanagers that take care of the size and location and that kind of things
 
how do you ever follow the code @Sippy?
 
I try not to.
But there's a lot of F12.
 
@scheien that requires a reach too and then returning to normal positioning. Again... time lost
I could probably get fast if I used it.
 
So a vendor decides SSL v3 is a good idea to include in their proprietary servers. Now I got to deal with not being able to download the WSDL OR do any SOAP calls
 
12:41 PM
@scheien pinky shift and pinky _
 
Still can't see why it's a problem
right hand index on _ and pinky on right shift
 
Oh if any of you guys don't have Productivity Power Tools for VS already, they're worth.
Ctrl+Click to peek definition is my fav thing
 
Hey C#! I'm lurking again!
 
Hi Lurking! :D
 
@scheien wtf how the hell do you type?
 
12:43 PM
with my fingers on the keyboard.
:)
 
oh okay. That explains it. You have fingers
I see the problem
 
:D
____
 
@scheien ur weird
 
I'm terrible at typing
I shift with my thumb
 
@KendallFrey ............
 
12:44 PM
@Sippy: I know.
 
What WPM do you type at?
 
this keeps getting worse
 
You guys are all weird
 
@scheien wpm?
 
@Sippy 50-60 on a good day
 
12:45 PM
@Sippy What do you mean "you guys"?
 
You're weird too.
 
@KendallFrey Hahaha
 
hey guys can you help me please regarding sql
 
@user3783598 Ask. Your. Question.
 
12:45 PM
@JABFreeware: Dunno.
 
How am I going to use BETWEEN Operator with Text Value or what is the right syntax when you will select all products with a ProductName for example ending with any of the letter BETWEEN 'C' and 'M'?
 
sup, folks! I thought I could add a debug log "website" for my c# chat bot and I'm not finding any recent and ready to go websocket server and client code examples. I only find come client implementations and it's all from 2010 posts on SO, and everybody's talking how "websockets are coming to c# soon" in those old posts. Now that they've come I don't see the code examples (google search options → results from up to one year ago). Am I even gonna find anything simple and easy to use for this?
 
@scheien let me help you nitrotype.com
 
@user1306322 SignalR?
 
no idea, man, that's why I'm asking
 
12:47 PM
I just did it and got 95wpm
 
@JABFreeware: Wouldn't call that a fair contest since english isn't my native language.
 
@scheien oh. :( didn't think of that
 
but sure, I'll give it a go
 
@user3783598 I guess you would extract the last character of the string, and then use BETWEEN
 
how will i do that?
is this correct? WHERE RIGHT(TextValue, 1) BETWEEN 'C' AND 'M'
 
12:49 PM
@JABFreeware: 54
 
protected struct_that_represents_the_player_statistics_in_each_region x(int a, bool b, Func<struct_that_represents_the_player_statistics_in_a_region>)
{ ... }

...

var x = new class_that_manages_the_players_for_each_regional_server().x(23, false, () => return current_player_statics_in_the_region)
 
with a lot of typos :)
 
@scheien What's your native lang?
 
If I saw that I would go to sleep
 
@Sippy: norwegian
 
12:51 PM
Try that one :)
 
76
 
I can't THINK that fast I don't think
 
Lol
 
The one you linked @Sippy was just a bunch of random words. The english versions do have some context atleast :)
 
Nah English words are random too
 
12:56 PM
ah, was referring to the nitrothingy
 
Oh right
 
I'm still a slow writer though :p
 
@Sippy is that an app??????
 
type speed == maywether speed in running
 
texting speed :/
 
12:59 PM
@user3783598: I don't get it.
 
me too
haha
 
@JABFreeware No it's the link I sent you
 
hey guys i need your help please
 

« first day (1718 days earlier)      last day (3233 days later) »